Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > Visual Web Developer 2005
|
Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Web Developer 2005 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
 
Old November 3rd, 2006, 10:18 PM
Authorized User
 
Join Date: Apr 2006
Posts: 79
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via AIM to anujrathi Send a message via MSN to anujrathi Send a message via Yahoo to anujrathi
Default Query string to a external javascript file

 Hi experts,

 When we write JavaScript in an external .js file, then in the "src" Tag, Can we pass any query string variable instead of calling Function ?
If Yes, then Can we pass different query string variables in different places in the same page depending on the situation that which Value we have to pass in the Query String . In this situation, we will have to write whole "src" tag.

Its urgent,
Regards,
Anuj
 
Old November 7th, 2006, 03:40 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Anuj!!
Technically No you can't pass different querystring.<i.e. to Query string to a external javascript file >


On the other hand if you want to different values by making tempquery string then offcourse you can do this.
e.g ,
my page is "test.asp?firstname=x&lastname=y"
now i want to process two conditions
1>test.asp?firstname=x&lastname=y" //which is actual query string ,window.location.href value
2> and "test.asp?firstname=x&lastname=y&age=13&location=m ylocation"
or
"newfile.asp?firstname=x&lastname=y&age=13&locatio n=mylocation"
Solution-->put querystring in javascript variable call the external.js file ,
and again put newquerystring in same javascript variable and calll the same function of external.js file

If you have any other approach plz let me know.


<span id="spanid">&nbsp;</span>
<script language="javascript">
originalQueryString=location.href
</script>
<script language="javascript" src="process.js"></script>
<script language="javascript">
tempQueryString=location.href+" &newformfield=hello";
originalQueryString=tempQueryString
</script>
<script language="javascript" src="process.js"></script>

**********process.js***********
function callme()
{
str=document.getElementById("spanid").innerHTML+"< br>"+originalQueryString
document.getElementById("spanid").innerHTML=str
}
callme();

**********process.js End***********


Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign label or string to external html file Gin262 ASP.NET 2.0 Basics 2 May 30th, 2007 06:39 AM
Query string to a external javascript file anujrathi ASP.NET 1.0 and 1.1 Professional 1 November 4th, 2006 01:26 AM
External JavaScript with XSL NEO1976 XSLT 2 September 5th, 2006 07:19 AM
external CSS in JavaScript code webdesign Javascript 1 September 1st, 2006 04:35 PM
External Javascript to determine Navigation fs22 Javascript How-To 3 May 21st, 2004 03:42 PM





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