homepage Welcome to WebmasterWorld Guest from 54.226.235.222
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
JSP & JavaScript
can I have server-side includes in my script?
eeblet




msg:1479078
 6:10 pm on Apr 23, 2002 (gmt 0)

I want to:

-use JavaScript to change the innerHTML of a div

-not have to have many lengthy strings in my JS

Can I just have the strings be external files included via JSP? For example, something that looks like:

function displayDetails ( topic ) {

document.dynamicDiv.innerHTML = "<%@include file="/include/" + topic + ".jsp %>";

}

 

eeblet




msg:1479079
 6:55 pm on Apr 23, 2002 (gmt 0)

uh, OK -- don't think it'll work. tried a buncha variations, but I think that no matter what, the server will need to process it again....

joshie76




msg:1479080
 7:11 pm on Apr 23, 2002 (gmt 0)

Include files (asp, jsp etc) are included on the server side (when the file is requested). All the client (browser) sees is the content of your includes in the place where your include tags where. View your source through the browser and you'll see what I mean.

eeblet




msg:1479081
 7:12 pm on Apr 23, 2002 (gmt 0)

yeah, I know -- I be down wid the server-side includes. I was just being dumb. :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved