javascript function parameter problem

A

AAaron123

function openWindow(name, path, w, h) {

OpenWindow=window.open( path,name,...

Works if I call it with path parameter equal to

'Images/Mass1.jpg'

but not if it is equal to

'~/Images/Mass1.jpg'

after I move the calling program to a subfolder



What am I doing wrong?



Thanks
 
B

bruce barker

the "~" support (unlike unix based webservers) is supplied by asp.net
server controls that have a url property. you can either use a relative
url (../images) or user server code to determine the correct path and
write out to the javascript.

-- bruce (sqlwork.com)
 
A

AAaron123

Thanks to you both for clearing up the meaning of ~.
I had also tried ".." before my NG post.

The problem was that function openWindow was in a file that I didn't move to
the subfolder. It was that, not the images, that couldn't be found.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top