Re: Dynamic Loading of JS & CSS
Marcus Andersson <[email protected]> Tue, 07 Mar 2006 22:19:33 +0100
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Could you load the js-file with an extra request and eval() it?
/Marcus
Maninder, Singh skrev:
> Hello Guys,
>
> Following is my problem definition.
>
> I have a page (index.html) that has a button, clicking which an AJAX request is sent to the server (to server_response.html) and the result is populated in the mainContent div on index.html.
>
> Now server_response.html has a javascript include (include.js) in it. To take a simple case, include.js just has the following -
>
> alert('reached include.js');
>
> However, when the AJAX call is executed, the external js that comes with the server response is not evaluated. If I include inline js in server_response.html (eg <s*ript>alert('reached inside server_response');</s*ript>) this works fine.
>
> Similarly, if there is an external style sheet included, in IE even that is not evaluated.
>
> I have experimented with loading js using DOM - yes that works but only in IE & Firefox.
>
> What is the best workaround for it and what works in Safari?
>
> I know document.write is an alternative for safari but that loads the entire page again :(
>
> Any help would be appreciated.
>
> Thank you,
> Mandy.
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> Unsubscribe
> [email protected]
>
> List info
> http://www.quirksmode.org/dom/list.html
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
Unsubscribe
[email protected]
List info
http://www.quirksmode.org/dom/list.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wdf-dom/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/