Connecting Tech Pros Worldwide Help | Site Map

using variable in path

Cortney
Guest
 
Posts: n/a
#1: Jun 19 '07
If I have done this:

<script language="javascript">
var large="/graphics/00000001/main.jpg";
</script>


How would I write the MM_openBrWindow to use that variable?

So normally it is like this:

<a href="javascript:;" onClick="MM_openBrWindow
('imagepath','large','scrollbars=yes,resizable=yes ,width=540,height=540')">
View Large Image</a>

Where 'imagepath' is a hardcoded path. How can I write it to interpret and
use the variable "large" I defined above? Thank you
Darko
Guest
 
Posts: n/a
#2: Jun 19 '07

re: using variable in path


On Jun 19, 11:52 pm, Cortney <Cort...@nospam.comwrote:
Quote:
If I have done this:
>
<script language="javascript">
var large="/graphics/00000001/main.jpg";
</script>
>
How would I write the MM_openBrWindow to use that variable?
>
So normally it is like this:
>
<a href="javascript:;" onClick="MM_openBrWindow
('imagepath','large','scrollbars=yes,resizable=yes ,width=540,height=540')">
View Large Image</a>
>
Where 'imagepath' is a hardcoded path. How can I write it to interpret and
use the variable "large" I defined above? Thank you
I guess just without single quotes?

-Lost
Guest
 
Posts: n/a
#3: Jun 20 '07

re: using variable in path


Darko wrote:
Quote:
On Jun 19, 11:52 pm, Cortney <Cort...@nospam.comwrote:
Quote:
>If I have done this:
>>
><script language="javascript">
>var large="/graphics/00000001/main.jpg";
></script>
>>
>How would I write the MM_openBrWindow to use that variable?
It depends. You haven't shown the function definition for MM_openBrWindow.
Quote:
Quote:
>So normally it is like this:
>>
><a href="javascript:;" onClick="MM_openBrWindow
>('imagepath','large','scrollbars=yes,resizable=ye s,width=540,height=540')">
>View Large Image</a>
>>
>Where 'imagepath' is a hardcoded path. How can I write it to interpret and
>use the variable "large" I defined above? Thank you
Assuming it works as you previously said, I take it, it combines
"imagepath" and "large." Therefore, make sure imagepath plus your
"large" variable equal what you require. And then of course, unquote
"large."

Also, don't use the "javascript:" pseudo-protocol in links.

http://jibbering.com/faq/#FAQ4_24

Make it a valid link to a page that notifies the user JavaScript was
required for the previous action, that is why they are at the new page.
Quote:
I guess just without single quotes?
Why guess?

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Closed Thread