Pop up ASP Javascript

11/16/2009

Welcome to HTML in several different ways to code a popup window code. Your pop-up windows, javascript or is, DHTML, asp, you may choose to use code or other programming languages. If you keep visitors on your website, and do what is best and then, before you pop-up window that pops up, the visitor leaves the page there after.

There is no way to accomplish this with current popup code, but there is a group that has made some software that will quickly create code that you can insert in any web site and it will function in a similar way.

I state similar because the popup is not seen by the browser as a html popup window; instead, it is seen as part of the original html page (or asp, php, coldfusion, dhtml, or other programming language page). By implementing this, the group has managed to create a popup so it is impossible to block by browers. This is just incredible to me.

It only took my eyes once to know that I have contributed this piece of software. You can, as it works by our full review on the program by clicking here to check the HTML code generation pop-up program. Once on this page, pause for about 5 seconds, then press the mouse near the back button on the website ....... html on the page in the popup window films in rapidlybefore you are able to the back button. Awesome!

I did not create this program. I am just a huge fan. I have been creating websites for over 10 years and do have my collection of code generators and snippets of my favorite code, but when I saw this I instantly fell in love with it!

If you are still prefers the old-fashioned pop-ups, then the following information can help you find help to deal with. There are some people that do not mind to be a majority of their ads are blocked, they just want a free solution for right now. I understand. Certainly in my early years in developing websites, I would have thought before you buy a software to do something similar to what is I already know how.


OK, so here are some basics for newbies:
A popup window is a browser window that is smaller than standard pages, and usually without a standard browser features such as toolbars, scroll bars or navigation buttons. For example, this link will open a medium-sized pop-up window. Pop-up windows (aka popups) are often used to display specific ads, small box-style pages or messages about something, once you leave the main site.

Pop is one of the most sensitive effects for Web developers. More than one developer has been frustrated in trying to get popups to work correctly. In addition, some pop-abusive techniques from many websites are not functional and inaccessible by search engines.

Note, because I am writing actual within an article I am forced to spread the code out a bit. You should not do this in your actual web pages.

Surround this with the greater than and less than signs < >
SCRIPT TYPE="text/javascript"
function popup(mylink, windowname)

Surround this with brackets

if (! window.focus)return true; var href; if (typeof(mylink) == 'string') onClick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href=mylink; else onClick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href=mylink.href; window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); return false;

Surround this with the greater than and less than signs < >
/SCRIPT

So lets look at exactly what has been done.

The code is javascript, so you must use the start and closing script tags for javascript.
Then, you add the name of the function (popup in this example), the link to the popup html page, and give it a window name.
Because the popup code has a unique name, you can call it anytime - when the page opens or closes, when someone clicks on it, virtually after any action you wish to associate with the function.


You can also modify the width and height of the popup as well as decide if you want scrollbars to be visible. Those are the most used settings for popups.


Below is an example of how you can call that code snippet to action:

a onClick="javascript:pageTracker._trackPageview('/outgoing/article_exit_link');" href="popupfile.html" onClick="return popup(this, 'sample1')">my popup /a

The above code should be surrounded by <> around each of the a's.
sample1 = the name we gave to the popup window. So, make very sure you use that same name from our original javascript code (replace "windowname" with "sample1").

If you would like for the popups to be activated when a page is first loaded, then use the following code to launch the javascript.

Inside of the BODY tag, add:
BODY onLoad="popup('autopopup.html', 'ad')"

You see that a different html file is referenced in this instance and it has a unique name of ad.

One more key tip - Make sure the quotes and spacing are exactly as listed above or the link will function as a regular link.

Posted in: dhtml| Tags: Programming Javascript Code page program asp html dhtml popup window

Hot Posts

Latest posts

Tags

Others

Sponsors

asp.net interview questions