Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsWeb Design & DevelopmentClient Side ScriptingJavaScript right
  Closed Topic Start new topic
left right
P3D1G0
post Aug 3 2010, 05:00 PM
Post #1


Ninja
***

Group: Members
Posts: 162
Joined: 26-October 07
Member No.: 1,917



How's it going? So I was needing a little script that doesn't just generate a pop up, but when the link is clicked, the pop up appears and as well, it will direct the user to a new page. I don't have an example but know I've seen it other places.

I use a code similar to this:
CODE
<a href="http://www.yourweblog.com/yourfile.html" onclick="window.open('http://www.yourweblog.com/yourfile.html','popup','width=500,height=500,
scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,stat
us=no,left=0,top=0'); return false">About</a>


But have also looked at scripts where the javascript is included in the header. I'm not sure what would be a better source?
Go to the top of the page 
 
  + Quote Post
jack2012
post Aug 7 2010, 06:47 AM
Post #2


Newbie
*

Group: Members
Posts: 6
Joined: 7-August 10
Member No.: 152,031



I need more information. As it could be adware or a spyware or even a scareware.

1) Go to IE or your Web Browser>Tools>Internet Options>Security tab>Click on Restricted Sites icon>Click on Sites>Under 'Add This Website to the Zone', Type >Add>Close>OK.Url that is trust onto your IE>Add>Close>OK.

2) IE>Tools>Manage Add On>Click on Toolbars Extensions>Disable any unknown add on. (Make sure that all add on is chosen at the bottom left of the page).


_______________________________________________________________________

This post has been edited by zpcs: Dec 18 2012, 01:05 PM
Reason for edit: Removal of SEO Link Building - Forbidden
Go to the top of the page 
 
  + Quote Post
jer-k
post Sep 11 2010, 02:54 AM
Post #3


Newbie
*

Group: Members
Posts: 6
Joined: 8-September 10
From: United Kingdom
Member No.: 156,066



You could do this..

In the <head> section create a function to generate a popup rather than have a massive chunk of code in the link itself.. such as:

CODE
function launchPopup(url){
   window.open(url, 'popup', 'width=500, height=500, scrollbars=no, resizable=no, toolbar=no, directories=no, location=no, menubar=no, status=no, left=0, top=0');
}


Now for the link.. far less cumbersome:

CODE
<a href="http://www.yourweblog.com/yourfile.html" onclick="launchPopup('http://www.yourweblog.com/yourPOPUPfile.html')">About</a>


Notice i removed the "return false" from the link, as that would disable the original link from loading the "yourfile.html".

This is all assuming that i have correctly understood you and you want both the main page to change AND for a popup to be generated?

Other stuff you could now do with this would be to allow the function to take more parameters, for instance you may want to define the width and height within the link tag so if you had multiple link instances requiring a popup they could be easily made to vary. Also you could have the function find out the visitors screen size and then using the width/height values sent it could load create the popup in the center of their screen?

Hope this was useful in some way smile.gif

P.S: Popups are horrible! ...just needed to get that off my chest..
Go to the top of the page 
 
  + Quote Post
jeffreylee
post Mar 22 2011, 05:08 PM
Post #4


Newbie
*

Group: Members
Posts: 24
Joined: 7-December 10
Member No.: 168,190



for that you need to read JS tutorials. Once you familiar with that then you may able to use that
Go to the top of the page 
 
  + Quote Post
EvilMastermindsP...
post May 14 2011, 09:46 PM
Post #5


Member
**

Group: Members
Posts: 47
Joined: 15-March 11
Member No.: 182,002



Use this:
CODE
<a href="java script:void(0)" onclick="window.open('http://www.yourweblog.com/yourfile.html','popup','width=500,height=500,
scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,stat
us=no,left=0,top=0'); return true;">About</a>

Setting the href attribute of the <a> tag to "java script:void(0)" makes the <a> tag like a button.
It only runs JavaScript when clicked, and does not redirect...
Go to the top of the page 
 
  + Quote Post
 Closed Topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 20th June 2013 - 01:31 PM