Forum Moderators: open

Message Too Old, No Replies

Two jscripts into one?

         

reamere

12:54 am on Dec 6, 2006 (gmt 0)

10+ Year Member



I'd like to have one script that does multiple things.
Basically, users will be clicking a link in a post on my bulletin board system. I want this to bring up a new window that will play a media file. However, I don't want them to see the toolbars or the URL, and I want the window to be resized. I can't seem to do this in one script without the user having to click a second link.

Write now I have two scripts. I'd like one script that does both. So hopefully the user will not have to click a second link.
Here's what I have now:
1.

<a href="javascript:void(0);"
onclick="window.open('index.htm','winName','width=700,height=600, top=50,left=50')">Click here to start.</a>

This brings up a new window, which is resized, and has no toolbars.

2.

<SCRIPT LANGUAGE="JavaScript">
window.location="index2.html"

This redirects to another page automatically.

I think that should get my point across. I would be most appreciative if anyone has some hints for me.

Thanks

PS: I am using Vbulletin. This does not seem to want to allow me to place jscripts into the body of a post.

phranque

3:07 am on Dec 6, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



there are probably some security issues with allowing javascript in public contributions by default.

i would try something like:

onclick="window.open('index.htm','winName','width=700,height=600, top=50,left=50'); window.location='index2.html'; return false"

reamere

3:53 am on Dec 6, 2006 (gmt 0)

10+ Year Member



Thanks, I had something like that, I think I missed the last semicolon. Although I can't get your code to work properly...

But you are right. By default, most forums will not allow those types of HTML tags like onclick.

Perhaps there is a way to allow any HTML tags for specific forums. I'll ask more on the vbulletin help forums.

Thank you much!