Yes, I was aware of this. There is a recent thread where we discovered
this as well in regards to injecting stylesheet node elements.

What I don't quite understand why it was a problem because it was
indeed evaluated, but it failed to see the id in dom.  It sounds it
more about where jQuery created and appended the script tag.  I would
like to study the code, but one of the things that immediately hit me
in the previous thread was the logistics of whether it was a good idea
to automate the eval() without providing an option for backward
capability (i.e, disableAutoEvaluate : true | false)

--
HLS



On Sep 1, 7:00 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> You used to have to manually tell jQuery to evaluate javascript like
> that using evalScripts, but this is done by default now in 1.1.4.
> Search for "evalScripts" on this page:
>
> http://jquery.com/blog/2007/08/24/jquery-114-faster-more-tests-ready-...
>
> --Erik
>
> On 9/1/07, Pops <[EMAIL PROTECTED]> wrote:
>
>
>
> > Kevin,
>
> > Thats interesting. I just switched it to 1.1.3 and I now see what you
> > were talking about.  Oh gosh,  you weren't making things up. :-)
>
> > I have to keep this mind for future stuff when we begin to embed
> > current html with native DOM reference statements.
>
> > --
> > HLS
>
> > On Sep 1, 10:44 am, <[EMAIL PROTECTED]> wrote:
> > > Hi,
>
> > > I see the fix - you are using the latest version of jquery (1.1.4). I was 
> > > using 1.1.3.1 .  When I started using the latest version your code 
> > > suggestions started working!  I appreciate the help with loader code too, 
> > > that worked great!  I tested on FF (pc/mac), ie
>
> > > Thanks again for all of your help,
>
> > > -Kevin
>
> > > > From: [EMAIL PROTECTED]> To: jquery-en@googlegroups.com> Subject: 
> > > > [jQuery] Re: AJAX GetElementByID problem> Date: Sat, 1 Sep 2007 
> > > > 00:08:22 -0700> > > > > On Aug 31, 6:38 pm, <[EMAIL PROTECTED]> wrote:> 
> > > > > > as you suggested and while it does run the alert message, it> > 
> > > > still fails out on the document.getElementByID in the destination> > 
> > > > page with the same error: TypeError: document.getElementById("blah1")> 
> > > > > has no properties> >> > Would you be able to paste in your sample app 
> > > > that you created? I> > am probably missing something small.> > <html>> 
> > > > <head>> <title>Blah Blah</title>> > <style>> body {> margin-left: 5%; 
> > > > margin-right: 5%;> color: crimson; background:#1C1C1C;> }> > 
> > > > #ajaxLoader {> text-align: center;> border: 1px solid silver;> color: 
> > > > yellow;> background: green;> float: right;> }> </style>> > <script 
> > > > type='text/javascript' src="/public/js/jquery-1.1.4.js"></> script>> > 
> > > > </head>> <body>> > <h3>Kevin's Blah Test</h3>> > <div id="destDiv1">> 
> > > > <script language="JavaScript">> var s = "";> s += "<div 
> > > > id='ajaxLoader'>";> s += "<img src='/public/js/loader.gif' 
> > > > alt='Loading...' />"> s += "</div>";> $("#destDiv1").html(s);> > 
> > > > $.ajax({> url: '/public/blah1.htm?a=' + Math.random(),> type: 'GET',> 
> > > > dataType: 'html',> timeout: 60000,> error: function(a,b,c){> 
> > > > $("#destDiv1").html('Error loading channel'> + a + "|" + b + "|" + c);> 
> > > > },> success: function(thehtml){> // do something with HTML> 
> > > > $("#destDiv1").html(thehtml);> }> });> > </script>> </div>> > </body>> 
> > > > </html>> > Note:> > The blah1.htm has this:> > <div id="blah1"></div>> 
> > > > <script language="JavaScript">> alert("hi");> 
> > > > document.getElementById("blah1").innerHTML = "<strong>hi</strong>";> 
> > > > </script>> > Other than clean up code, making easier to read, adding my 
> > > > loader.gif> plus style, it is pretty much the same code but use jQuery 
> > > > to add the> html() so that any script tags are executed.> > If the 
> > > > problem persist, then you might want to describe the browser> you are 
> > > > testing it with. I tested the above with IE and FF.> > Hope this helps> 
> > > > > > PS: It was ajaxing so fast with my local server, to see the loader 
> > > > in> action, what I did was wrap the $.ajax() in a timer like so:> > 
> > > > setTimeout(function () {> > .. the above ajax statement ..> > },3000);> 
> > > > > --> HLS>
>
> > > _________________________________________________________________
> > > Invite your mail contacts to join your friends list with Windows Live 
> > > Spaces. It's 
> > > easy!http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friend...

Reply via email to