Time:
Scotland: Fri, 8:06 pm
Rhode Island: Fri, 3:06 pm
Florida: Fri, 3:06 pm
New Mexico: Fri, 1:06 pm
California: Fri, 12:06 pm

Click here to visit Livelife365.com

Click here to visit nmdarts.com



Buy this Ad Space.

180px wide.

Please get in touch with KH@ if you are interested and make an offer.

CLICK HERE TO GET AUCTION BAR NOW
US$10 per year - Save $100s!
The Fabulously Unfair
WebX Auction Bar. For Ebay etc.
Ro-Sham-Bo the opposition. Laugh like Eric Cartman when you win! CLICK HERE NOW!


More information and sign-up.

WebXpertz Hosting.
Custom fit from $5pm. PHP/MySQL
You'll save money, we'll save money. Seems fair to me. Interested? If so Please PM me here and tell me what you need. Thanks!


Please click here for more information

For continued disscussion on this topic : grab a url variable with javascript


muscle
07-07-2003, 09:58 PM
I've got a coldfusion app I've built, but now needs to be static for a cdrom. In one particular part, I'm passing the following variables...

<a href="javascript:pop_window('slideview.cfm?presentation=1&slide=1')" name="slide1">

Then in my slideview.cfm page, I'm pulling the two variable and displaying them like so...

<img src="#presentation#/slides/Slide#slide#.jpg" width="400" height="300" border="0" alt="">

Is there a way to do this with javascript? Thanks beforehand!!

Arielladog
07-07-2003, 10:48 PM
Hey muscle,

Read the JavaScript FAQ as it's in there:

http://www.webxpertz.net/faqs/jsfaq/passvars.php#formurl

Then, you could just use something like:

document.write('<img src="' + search["presentation"] + '/slides/Slide' + search["slide"] + '" width="400" height="300" border="0" alt="">');

aDog :cool:

muscle
07-08-2003, 05:07 PM
Thank you soo much for the prompt response and answer. I usually check that forum post before, but for some reason I neglected to this time. Thanks again. I was hoping to ask you a second question. I'm a coldfusion guy, so I'm still trying to get this javascript stuff down. I'm using the following snippet of code to determine if a next/previous button should be shown and then having it link to the next slide like so...

<cfif theSlidePosition neq 1>
<a href="slideview.cfm?presentation=#presentation#&slide=#ListGetAt(slideNum,(theSlidePosition - 1))#"><img src="../assets/headers/previous.gif" width="81" height="20" border="0" alt="Previous"></a>
<cfelse>&nbsp;</cfif>

<cfif theSlidePosition neq listLen(slideNum)>
<a href="slideview.cfm?presentation=#presentation#&slide=#ListGetAt(slideNum,(theSlidePosition + 1))#"><img src="../assets/headers/next.gif" width="57" height="20" border="0" alt="Next"></a>
<cfelse>&nbsp;</cfif>

so for example, if it's slide 1, you wouldn't see a previous button, but you would see a next button with a link to the next one. Is there a way to accomplish this in javascript, or am I shooting up the wrong tree. Thanks beforehand!!!


Modified code...

<html>
<head>
<title>Preceptorship Training Manual</title>
<script type="text/javascript">
//<![CDATA[
function parseSearchString()
{
var pairs=unescape(location.search.substring(1).replace(/\+/g," ")).split('&');
for (var i=0;i<pairs.length;i++){
var pair = pairs[i].split('=');
this[pair[0]]=pair[1];
}
}
var search = new parseSearchString();

//output passed variables
document.write('<div align="center">');
document.write('<img src="' + search["presentation"] + '/slides/Slide' + search["slide"] + '.jpg' + '" width="400" height="300" border="0" alt="">');
document.write('</div>');
//]]>
</script>
</head>
<body leftmargin="10" topmargin="10" marginheight="10" marginwidth="10" bgcolor="#ffffff">
</body>
</html>