0

I'm struggling to find out when to use #,$ in jquery. i.e. if I have an object

var elem{
}

How to access this? Whether $('#elem') or $('elem')? May be its too silly. But I cant find out a solution by googling it.

2
  • What version of IIS are you using and how is your webapp set up in IIS? Non-aspnet extensions might be handled by IIS only so they skip global.asax (and the rest of the aspnet pipeline). Commented Jul 13, 2011 at 8:49
  • What's with the edit to completely change the question? If you have a new question then post it as a separate question. (You should change this one back so that the existing accepted answer actually makes sense.) Commented Feb 15, 2012 at 2:29

1 Answer 1

1

It looks to me like how to you've used .appendTo(). You need to pass an ID in your case, I believe; something like:

$("<table>").attr("id","waiterBlock").appendTo("testDiv");

Changed to:

$("<table>").attr("id","waiterBlock").appendTo("#testDiv");

The documentation for jQuery's .appendTo() says one needs to pass:

A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.