Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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

  #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>



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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.