Time:
Scotland: Sat, 6:41 am
Rhode Island: Sat, 1:41 am
Florida: Sat, 1:41 am
New Mexico: Fri, 11:41 pm
California: Fri, 10:41 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.

Selanac Embroidery and Screen Printing

Embroidery
Screen Printing
Signs and Banners
Promotional Advertising

WEBSITE

Contact Paul Canales
TEl: USA 732-901-8417
CELL: USA 732-773-1339


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>