Dynamic Loading of JS & CSS

"Maninder, Singh" <[email protected]> Wed, 8 Mar 2006 00:27:39 +0530
Newsgroups gmane.comp.web.dom.wdf
Message-ID <4D8B620F4FDA414982B23A3E7F6A8EF113409202@hydmail01.hyd.corp.int.untd.com>
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

<*> 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/