javascript popups

He has: 1,380 posts

Joined: Feb 2002

ok...i have researched this, and i cant find out how to do it the way i want. i need a pop up window to come up when you click on a link, but not until then...the problem is...the link is inside a javascript menu already...what do i do?

He has: 1,016 posts

Joined: May 2002

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

if you have control over the link itself you can use the code zollet suggested (or zerocattle.com/examples/popUp.html for one that's better for the user and search engines), but if you don't, you may not have the ability to do it.

He has: 1,380 posts

Joined: Feb 2002

addChildmenuItem("http://www.hotscripts.com/","HotScripts","","");'
is the link inside the js menu

He has: 1,380 posts

Joined: Feb 2002

i mean something like the javascript:history.back()

lol...i dunno if there is something like this, maybe its just non-existant..."javascript:new.windo(http://url.com)" lol

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Quote: Originally posted by Eskater05
addChildmenuItem("http://www.hotscripts.com/","HotScripts","","");'
is the link inside the js menu

If you read the url I sent you, you would see that you could make the link like this:

addChildmenuItem
("javascript:popUp('http://www.hotscripts.com/',
'name of window','width=xxx,height=xxx')
","HotScripts","","");
'

That *should* work. xxx would hopefully obviously be the actual numbers for width and height. Remove all hard returns (only in place so the board won't scroll).

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

Suzanne the url is bringing up a 404!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Thanks, Julia, I fixed it. Forgot to capitalize the U. Wink

He has: 1,380 posts

Joined: Feb 2002

i did read it...its a dead link...but i see you fixed it...thanks

He has: 1,380 posts

Joined: Feb 2002

ok....i tried it...the first time i tried it verbatim (without the width and height..i figured that could set on its own, it should just be a regular window)...i got a 404...the second time, i tried it as "javascript" instead of "java script" and i got a javascript error...on line 1 character 1, and it said an object was expected...

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Kyle, you don't know the first thing about JavaScript, right?

Okay:

1. The board automatically changes the word to java script so people can't put scripts up and break the board.
2. Did you put the function in your header?
3. When mixing JavaScript scripts, you may have conflicts. You must know at least a little bit to get it working.
4. You can't just leave out pieces of JavaScript. If you don't want the width, height parts, you'll still have to have and empty set ''
5. AS ALWAYS, a url where people can see where you're screwing up live is the best way to get help. SET UP A DUMMY PAGE IF YOU NEED TO.

He has: 1,380 posts

Joined: Feb 2002

haha...you caught me...anyways...i did catch on to the "javascript" word spreader thing...but i forgot to mention that this whole thing is a .js file...its not embedded, i have a few scripts in the header of my main .html document that calls out this script...but its not directly on the page...and i will try to setup a dummy page...we'll see what happens

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

I meant the script that I pointed you to -- it won't work if you don't have that function in your tags. You really should at least figure out how JavaScript works, for your own sanity, even if you don't intend to write your own scripts.

He has: 1,380 posts

Joined: Feb 2002

lol...thanks...lol

He has: 1,380 posts

Joined: Feb 2002

i decided to give up...it isnt worth all this trouble...the way it is works fine ...*sigh*...o well, thanks anyways

openmind's picture

He has: 945 posts

Joined: Aug 2001

Quote: Originally posted by Suzanne
You really should at least figure out how JavaScript works, for your own sanity, even if you don't intend to write your own scripts.

I tried to learn JavaScript once and thats what sent me the way I am now....wibble....I'm a fish....

He has: 1,380 posts

Joined: Feb 2002

haha....i dont write javascript...hurts my head

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.