need help with an html code
I want to be able to have banners set up so that when someone clicks on them it not only opens a new window but also take them to another page in my site. In other words, for them to view the content of one my pages, they would have to click on a banner. Can this be done? If so, what is the html code?
mmi posted this at 07:28 — 15th March 2003.
They have: 457 posts
Joined: Jan 2001
hey Picks2Play - yes, this is easily done, but I believe it involves javascript, not just html -
(there may be other ways of doing this, dunno)
here's a function I use to open more than one window on mmy site:
function hotlinks(URL) {
window.open(URL,'hotlinkswin','location=yes,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,width=645,height=390,screenX=20,screenY=20,left=20,top=20');}
<a HREF="javascript: hotlinks('http://www.essential.org/')">Essential Information</a>
'I can't say how banners might complicate this - dunno anything about 'emyou should be able to easily find tutorials about this online if mmy example isn't useful or clear
Web Xpertz Community Forums for Webmasters & Developers
Where You Can Learn, Advise, and Have Fun in the Process
Picks2Play posted this at 07:49 — 15th March 2003.
They have: 18 posts
Joined: Mar 2003
mmi, all thanks for helping me out. You probably figured out that i'm a rookie so It might sound dumb but do I have to use both codes you mentioned or just the 2nd one?
Picks2Play posted this at 07:53 — 15th March 2003.
They have: 18 posts
Joined: Mar 2003
I have no clue how javascript works!
mmi posted this at 07:56 — 15th March 2003.
They have: 457 posts
Joined: Jan 2001
ya need both - the js goes in yer page's head and the html in the body
don't hesitate to post back with Q's; everybody learned at some point - but I figure you make better progress by using tutorials (either online or from books) and then asking for help when ya get stuck
clueless, eh? - I'm gonna risk getting in trouble by pointing you to a set of js tutorials from mmy hometown
http://www.pageresource.com/jscript/
this might open some, ah ..., windows for ya
Web Xpertz Community Forums for Webmasters & Developers
Where You Can Learn, Advise, and Have Fun in the Process
Picks2Play posted this at 08:19 — 15th March 2003.
They have: 18 posts
Joined: Mar 2003
Thanks!! will use them and then get back on here if I get stuck!!
mmi posted this at 15:00 — 15th March 2003.
They have: 457 posts
Joined: Jan 2001
hey P2P
there are a couple of problems with the code I put up - maybe I can help unstick ya before ya get there
1) when ya post scripts onto a site like this, they're typically modified so bad things don't/can't happen -
the server adds some spaces so scripts can't be executed - something like that -
I repaired the one in the html, but not the one in the script - hmmm, the server's defences seem
to be resistant to this fix - you need to delete the space in "window. open"
2) some scripts (or parts of them) need to be on one line of code to operate - you need to eliminate
the break in the line beginning "window"
3) browsers require <script> tags in order to recognize js - I didn't put those in
soooo, let's try this again
<head>
<script LANGUAGE="javaScript" TYPE="text/javascript">
function hotlinks(URL) {
window.open(URL,'hotlinkswin','location=yes,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,width=645,height=390,screenX=20,screenY=20,left=20,top=20');}
</script>
</head>
<body>
<a HREF="javascript: hotlinks('http://www.essential.org/')">Essential Information</a>
</body>
the way this script is written allows you to code the html for more than one popup a little more economically -
I wanna give you another example of a way to write this which may more closely match others you're
likely to find - it's at http://ememi.com/tmp/popup.html
now get poppin'
Web Xpertz Community Forums for Webmasters & Developers
Where You Can Learn, Advise, and Have Fun in the Process
Timewell posted this at 15:58 — 15th March 2003.
They have: 344 posts
Joined: Jun 2002
Why not simply use:
target="_new"
'It opens a new window and is easy to remember and implement.
The Webmistress posted this at 16:18 — 15th March 2003.
She has: 5,586 posts
Joined: Feb 2001
Because he wants to not only open up a link to another site in a new window but also change the page on his own site in the existing window.
Timewell posted this at 17:00 — 15th March 2003.
They have: 344 posts
Joined: Jun 2002
aah...well...you learn something new every day!
Picks2Play posted this at 17:46 — 15th March 2003.
They have: 18 posts
Joined: Mar 2003
Hey mmi,
I went to the link you gave me (http://ememi.com/tmp/popup.html) and clicked on it and it opened a new window but the page did not go to another page.
Thanks anyways, I'll see if someone knows how to do that in other webmaster forums.
Suzanne posted this at 18:39 — 15th March 2003.
She has: 5,507 posts
Joined: Feb 2000
zerocattle.com/examples/popUp.html
You have to name your window (the one before you popup one) -- then you can control the parent page from the popup or from the link that creates the popup.
What you would do is have another argument in your onclick function, one to popUp(); and then another to change the location.href of the parent page.
mmi posted this at 23:53 — 15th March 2003.
They have: 457 posts
Joined: Jan 2001
hey - as Suzanne noted, in this
function openEastWindow() {eastWindow=window.open('east.doc','eastWin',...
'you need to specify a document - something to replace "east.doc"I was not in a position to identify the document on yer site that you want to open
sorry if I didn't make that clear
Web Xpertz Community Forums for Webmasters & Developers
Where You Can Learn, Advise, and Have Fun in the Process
Picks2Play posted this at 05:57 — 18th March 2003.
They have: 18 posts
Joined: Mar 2003
I haven't been able to do this, can someone please post a sample code and I'll just replace with my information.
Suzanne posted this at 06:01 — 18th March 2003.
She has: 5,507 posts
Joined: Feb 2000
To clarify, since you're having problems (per your PM) -- banner
Which will, ideally, pop the banner ad page into a new window and change your parent window to the right page.
In answer to your question about which part you need, please read the tutorials included in that link. In order to make this work as you intend it to (which is an interesting idea, but very easy to circumvent and won't work for people with JavaScript disabled), you'll need all parts of the script.
Picks2Play posted this at 22:14 — 18th March 2003.
They have: 18 posts
Joined: Mar 2003
My home page where the banner will be at: index.html (website address: picks2play.com
Page that I want to change too upon banner click: freepicks.html
New window will open upon clicking on the the Pay-per-click banner. Here's the code:
Ok, now what goes where?
banner
"whatever.html" What Goes here?
'whatever.html' What Goes here?
etc. etc.
Thanks!!
Suzanne posted this at 23:27 — 18th March 2003.
She has: 5,507 posts
Joined: Feb 2000
You don't have control over the new window, since it's for the advertiser's site, right?
You won't get click-throughs if you have the banner go to your page then spawn a new window onLoad.
So, hmmm...
Suzanne posted this at 23:46 — 18th March 2003.
She has: 5,507 posts
Joined: Feb 2000
Okay, here you go. The price is you have to buy the next person in line's coffee or meal or whatever. DON'T BE STINGEY or your karma will suck.
Basically, set the real page as the href and don't kill it with the "return" -- and you really should be reading those tutorials.
Picks2Play posted this at 05:07 — 19th March 2003.
They have: 18 posts
Joined: Mar 2003
Suzanne,
Thanks for all your help. I just load it the code you gave me and the banner appeared and when I clicked on it, it changed to the page of my choice but a new window DID NOT pop-up (the one that's suppose to open up for the pay-per-click site)
Actually, Let me know where I can send you a little something for helping!!
(Paypal, StormPay, etc.)
Picks2Play posted this at 05:09 — 19th March 2003.
They have: 18 posts
Joined: Mar 2003
Was I suppose to insert a javascript code like mmi said?
Suzanne posted this at 05:15 — 19th March 2003.
She has: 5,507 posts
Joined: Feb 2000
no no, you must help someone else. that's how this works. otherwise you'd just hire me.
yes, you'll need to have the JavaScript function (the one from my link?) in the head section of your page -- <script type="text/javascript" src="popup.js"></script> -- or have the script in your head tags as is --
<script type="text/javascript>
function popUp( blah blah
}
</script>
Can you follow that without explicit direction? The function (that opens the new window) has to be in the head element.
Or you can use mmi's javascript code instead of the function. It depends on whether you'll need to do this more than once or not on your page or on your site. If you'll use it more than one, using a function is better.
Picks2Play posted this at 07:51 — 19th March 2003.
They have: 18 posts
Joined: Mar 2003
You are going to kill me Suzanne, still no pop-up window.
I created a test page, check it out: http://www.picks2play.com/testpage.html
View the source and please tell me what I did wrong or what I left out!
Suzanne posted this at 15:09 — 19th March 2003.
She has: 5,507 posts
Joined: Feb 2000
The code looks fine, so you may want to upload that script, eh?
http://www.picks2play.com/popup.js <-- 404
Download this and save it as popup.js to your own server:
http://www.zerocattle.com/scripts/popup.js
THEN it will work.
Picks2Play posted this at 19:42 — 19th March 2003.
They have: 18 posts
Joined: Mar 2003
I downloaded the popup.js to my computer and I know how to upload that from my desktop (right click on the shorcut icon & upload using my WS_FTP Upload Wizard) but how do I go about uploading that script <------- probably dumb question but what can I say...lol
Suzanne posted this at 19:46 — 19th March 2003.
She has: 5,507 posts
Joined: Feb 2000
oh boy. do you know how to use WS_FTP to connect directly to your website? Just like an .html file, you would upload the popup.js file.
Picks2Play posted this at 20:41 — 19th March 2003.
They have: 18 posts
Joined: Mar 2003
Yes I do know how to upload using my WS_FTP, hard to believe huh?...lol
I uploaded the popup.js and now is working!
You are a class act, thanks a lot for all your help. I will gladly pay it forward!!
I wish nothing but the best to you and your love ones!!!
Suzanne posted this at 20:42 — 19th March 2003.
She has: 5,507 posts
Joined: Feb 2000
Heh, glad it's all working.
Picks2Play posted this at 20:48 — 19th March 2003.
They have: 18 posts
Joined: Mar 2003
Also want to thank mmi
Picks2Play posted this at 21:04 — 19th March 2003.
They have: 18 posts
Joined: Mar 2003
Suzanne, don't mean to bother you but I tried to see if it would also work for text links and it did except for this: Instead of the page changing and going to to one I assigned (freepick.html), it goes to my home page. Why is that?
I used the same one you gave me but took out the banner code and put the text instead:
Today's free pick
Picks2Play posted this at 21:49 — 19th March 2003.
They have: 18 posts
Joined: Mar 2003
Nevermind, I just saw why -------> ("")freepicks.html"
had an extra (")
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.