Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 4th, 2006, 02:58 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamic SRC argument

I am trying to use a variable as a SRC argument. Does anyone have any idea on how to proceed.

<script src="MYVARIABLE"></script>

Thanks in advance

Reply With Quote
  #2 (permalink)  
Old April 5th, 2006, 01:38 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Problem solved, here's the solution. I hope it helps somebody on a dark day:

<script type='text/javascript'>
var url = 'partofURL'+MYVARIABLE+'anotherpartofURL';

var jsi = "<" + "script type='text/javascript'"
jsi += " src='" + unescape(url) + "'></" + "script>";

document.open();
document.write(jsi);
document.close();
</script>

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
$@src newbieboobers XSLT 2 March 12th, 2008 04:22 PM
replace src URL billbillbill Classic ASP Basics 1 August 12th, 2007 01:03 AM
chapter2-src\src\ch02\sample5 _ need help M7777777bill BOOK: Professional Java Development with the Spring Framework 0 June 14th, 2006 10:00 PM
Script src problem Snib Javascript 5 December 30th, 2003 03:33 PM



All times are GMT -4. The time now is 09:37 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.