Welcome to WebmasterWorld Guest from 54.226.242.132

Forum Moderators: open

Message Too Old, No Replies

JSP & JavaScript

can I have server-side includes in my script?

     

eeblet

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

Inactive Member
Account Expired

 
 


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

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

Inactive Member
Account Expired

 
 


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....
7:11 pm on Apr 23, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 10, 2001
posts:793
votes: 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

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

Inactive Member
Account Expired

 
 


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members