--- Michael Lo <[EMAIL PROTECTED]> wrote:

> Try this
> 
> $.get('page.html',function(data){
> ($('#target').html(data);
> });
> 
> Michael

The problem seems to be that IE strips script and
style tags on incoming with the xmlrequestobject and
firefox doesn't...

I'm shocked that this issue isn't noticed or discussed
more, but I guess I'm just too new to this to know
these kinds of things.

Does anyone know a way to force this behavior to
change on IE, or do I need to come up with a different
workaround?

If someone assists me I promise to add details to the
wiki someplace obvious.

Thanks!

--John

PS, if we could all try to not top post it will help
us follow long discussion threads!  Thanks!




> 
> On 8/24/07, John Napiorkowski <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >
> > --- polyrhythmic <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > John,
> > > What version of jQuery are you running?  And
> what
> > > are your browser
> > > versions?  Also, <style> tags must be placed
> inside
> > > the <head> tags.
> > > jQuery makes it easy to manipulate DOM styles
> from
> > > AJAX data, but if
> > > you would like to import styles as inline HTML
> you
> > > must style each
> > > invidual element using its style attribute:
> > > <element style="foo: bar;" >
> > >
> > > Charles
> > > doublerebel.com
> >
> > I am using the latest JQuery from the download
> area.
> >
> > What I have is a full webpage that I am
> dynamically
> > injecting some HTML into via $.load(...) and that
> > injected bit has a style and script block.  On
> FireFox
> > it seems that that scripts and styles get
> activated,
> > but on IE is doesn't.  For example if I put a
> >
> > <script>alert(1)</script>
> >
> > into the injected page, on FF I see the alert when
> the
> > page loads, but on IE I don't.
> >
> > To be honest this is a huge difference in
> behavior, so
> > I figure I can't be the only one that ran into the
> > trouble.  It looks like JQuery does some sort of
> eval
> > if it finds a script tag, but Maybe IE is removing
> > them.  Anyway, just trying to figure out If I can
> make
> > this work or not.
> >
> > Thanks for your reply and I hope I've described my
> > issue correctly.
> >
> > --John
> >
> >
> > >
> > > On Aug 22, 9:47 pm, John Napiorkowski
> > > <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> > > >
> > > > I'm sure this is a stupid error on my part but
> > > it's
> > > > driving me crazy.  I have a bit of html that I
> > > want to
> > > > inject into my page like so:
> > > >
> > > > $('#target').load('page.html');
> > > >
> > > > Now this works, but I find that if 'page.html'
> > > > contains a script and style section IE won't
> > > process
> > > > it, but Firefox seems to.  What I mean is that
> if
> > > the
> > > > 'pages.html' itself contains some inline
> > > javascript
> > > > than Firefox will execute it but IE doesn't.
> > > >
> > > > So for example my 'pages.html' might look like
> > > (this
> > > > is abbreviated, but I think you'll get the
> idea):
> > > >
> > > > <div id="container">
> > > >   <style>
> > > >     form { ... }
> > > >   </style>
> > > >   <script>
> > > >     $()ready({ ... });
> > > >   </script>
> > > >   <!-- More html that the above works on -->
> > > > </div>
> > > >
> > > > Putting aside for the moment about whether or
> not
> > > > inline script sections is a good idea or not,
> does
> > > > anyone know why this would work on Firefox
> only
> > > and is
> > > > there any workarounds?  My client's setup
> makes
> > > > anything but inline scripting a nightmare, so
> I am
> > > > hoping to solve this.  If I can't make this
> work
> > > I'll
> > > > have to us popup windows, so please help me :)
> > > >
> > > > I saw something in the docs about $.getScript
> > > versus
> > > > $.get but I didn't see how this could help. 
> The
> > > only
> > > > thing I found was a call to "evalScripts" in
> the
> > > > source, but I couldn't find documentation for
> > > that, so
> > > > I didn't play with it.
> > > >
> > > > Thanks!
> > > > John Napiorkowski
> > > >
> > > >
> > >
> >
> >
>
____________________________________________________________________________________Ready
> > > for the edge of your seat?
> > > > Check out tonight's top picks on Yahoo!
> > > TV.http://tv.yahoo.com/
> > >
> > >
> >
> >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Sick sense of humor? Visit Yahoo! TV's
> > Comedy with an Edge to see what's on, when.
> > http://tv.yahoo.com/collections/222
> >
> 



       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. 
Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

Reply via email to