$
(document.createElement("div")).attr("id","error").text(json.bad).prependTo("body");

That works just fine, obviously you can mold it to your own needs.

But indeed, for dynamic script tags use getScript or getJSON.

On May 14, 7:48 pm, Carl Von Stetten <[EMAIL PROTECTED]> wrote:
> meppum,
>
> Take a look at the $.getScript() function.  
> Seehttp://docs.jquery.com/Ajax/jQuery.getScript#urlcallbackfor details.
>
> Carl
>
> meppum wrote:
> > I was thinking more like adding a script tag to the document.
> > Something equivalent to document.createElement("script");
>
> > On May 14, 5:55 pm, Carl Von Stetten <[EMAIL PROTECTED]> wrote:
>
> >> meppum,
>
> >> That is built into the core of jQuery.  For example, to create a new <p>
> >> element and append it to an existing div with an id of "mydiv":
>
> >> $('<p>New paragraph</p>').appendTo('#mydiv');
>
> >> or
>
> >> $("#mydiv").append('<p>New paragraph</p>');
>
> >> HTH,
> >> Carl
>
> >> meppum wrote:
>
> >>> What is the equivalent jquery code to document.createElement? I looked
> >>> all over but couldn't find an example.
>
> >>> -meppum- Hide quoted text -
>
> >> - Show quoted text -

Reply via email to