By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,717 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,717 IT Pros & Developers. It's quick & easy.

using variable in path

P: n/a
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
Jun 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jun 19, 11:52 pm, Cortney <Cort...@nospam.comwrote:
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?

Jun 19 '07 #2

P: n/a
Darko wrote:
On Jun 19, 11:52 pm, Cortney <Cort...@nospam.comwrote:
>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.
>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.
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.
Jun 20 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.