PDA

View Full Version : help on HTML codes


IniQx
23-12-2003, 03:18 AM
i nid help here. wat is de html code for de closing of de browser window? for eg: when i click dis particular link, de window of that webpage closes. i tried using dis:

<a href="javascript: window.close()">

but it only worked on de preview page. when i saved it & reload my page, it din quite work de way i want to. any xperts here? im using de code on angelfire & blogspot btw. :)

devilion
23-12-2003, 03:29 AM
<a href="javascript:window.close();">CLOSE</a>

Remove the underscore(_)

or u want a button type

<input type="button" class="button" value="Close this window" onclick="self.close()" />

Some will come out a prompt to ask to close the page. Juz click "Yes" or "Ok"

IniQx
23-12-2003, 11:02 AM
<a href="javascript:window.close();"><b>PLEASE LEAVE!</b></a>

ok. dis is de html code i paste on my web. but still, it din work :|

bloodcool
23-12-2003, 11:19 AM
<a href="javascript:window.close();"><b>PLEASE LEAVE!</b></a>

ok. dis is de html code i paste on my web. but still, it din work :|
put this code :- <a href="javascript:window.close();"><b>PLEASE LEAVE!</b></a>

dennis
23-12-2003, 11:20 AM
ermm this should work :


<a href="javascript:window.close();"><b>PLEASE LEAVE!</b></a>


without the underscores

java_script_ to javascript

by the way i think this forum s/w auto creates the underscore (prevent abuse) so if you copy and paste from here, remember to remove the underscore manually.

IniQx
23-12-2003, 11:26 AM
ermm this should work :


<a href="javascript:window.close();"><b>PLEASE LEAVE!</b></a>


without the underscores

java_script_ to javascript

by the way i think this forum s/w auto creates the underscore (prevent abuse) so if you copy and paste from here, remember to remove the underscore manually.

i did. all underscores are removed. but when i paste here de underscores appears on its own. so de code u guys gave me is wat i've oleadi pasted onto my web. it still cant work.. :cry1:

bloodcool
23-12-2003, 11:27 AM
if the forum s/w is this way, then i think what IniQx has done is correct.

bloodcool
23-12-2003, 11:42 AM
give u guys de link: http://deep.at/iniqxidlethoughts-words

just click on ".....PLEASE LEAVE!" see if it works. it din wrk on me. :|
take away the semi-colon ';'

or u can put this <a href="javascript:self.close()">PLEASE LEAVE</a> without the semi-colon

IniQx
23-12-2003, 11:48 AM
take away the semi-colon ';'

or u can put this <a href="javascript:self.close()">PLEASE LEAVE</a> without the semi-colon

cannot... :cry:

minik
23-12-2003, 02:10 PM
For IE:
<a href="javascript:top.window.close();"><b>PLEASE LEAVE!</b></a>

For Mozilla/Netscape: technically you are not able to close windows you do not own with scripts. However, this hack works: http://www.aspalliance.com/articleViewer.aspx?aId=333&pId=

lyk13
23-12-2003, 07:56 PM
For my case, when I click the link, it pop-up another window showing angelfire ads....:sweat:

Uhm, my javascript is rather rusty, even up till now. I played ard, and I found out if u use button, it can be very easy. BUT, if u are using links, abit more complicated. How about...try to find a site with the close window link, then see their code from there? One thing that I noticed is, .close() is mainly used to close the current active window or a window that was opened using the .open() method.

Reference:

http://www.w3schools.com/js/tryit.asp?filename=tryjs_closewindow
http://www.devguru.com/Technologies/ecmascript/quickref/window.html

I still suggest finding a site that has the close window link and see their source code ;)

bloodcool
23-12-2003, 09:24 PM
For my case, when I click the link, it pop-up another window showing angelfire ads....:sweat:

Uhm, my javascript is rather rusty, even up till now. I played ard, and I found out if u use button, it can be very easy. BUT, if u are using links, abit more complicated. How about...try to find a site with the close window link, then see their code from there? One thing that I noticed is, .close() is mainly used to close the current active window or a window that was opened using the .open() method.

Reference:

http://www.w3schools.com/js/tryit.asp?filename=tryjs_closewindow
http://www.devguru.com/Technologies/ecmascript/quickref/window.html

I still suggest finding a site that has the close window link and see their source code ;)
actually the code that i quoted is taken from a site which does window closing..

junkai21
23-12-2003, 11:00 PM
same. angelfire ads... :(

IniQx
23-12-2003, 11:21 PM
actually the code that i quoted is taken from a site which does window closing..

yah. i sort of "koup" de code frm a site tat has de click dis link & close dis window function...

IniQx
23-12-2003, 11:26 PM
For IE:
<a href="javascript:top.window.close();"><b>PLEASE LEAVE!</b></a>

For Mozilla/Netscape: technically you are not able to close windows you do not own with scripts. However, this hack works: http://www.aspalliance.com/articleViewer.aspx?aId=333&pId=

it din quite work either. mayb angelfire did some blocking to it. but de strange thing is, it works in de preview page -shrugs- i give up! anywae, thx alot guys & sorry 4 de trouble :)

lyk13
24-12-2003, 04:12 PM
Oh....ok....uhm....hope there is a way out though.

:btw: Suggestion: Please leave: Bring the user to a yahoo search page bahz....:laugh:

devilion
24-12-2003, 04:18 PM
Got one way maybe can work...

u put there... (press ctrl + w/alt F4) to leave... :)

waynez
24-12-2003, 06:06 PM
im using this

<a href="#" onclick="window.close();"><font color="#FF0000">close</font></a>

:yesyes:

lyk13
24-12-2003, 06:16 PM
:think: This might just work...I was wondering how come some sites after clicking on a link, it shows a "#" at the end of the url....

IniQx, try it. ;)

IniQx
24-12-2003, 09:08 PM
:think: This might just work...I was wondering how come some sites after clicking on a link, it shows a "#" at the end of the url....

IniQx, try it. ;)

can't wrk still :| it brings me to de top of de page...

lyk13
24-12-2003, 09:20 PM
can't wrk still :| it brings me to de top of de page...
Then again, ur evaluation seems logical too...:rolleyes:

minik
27-12-2003, 10:28 AM
it din quite work either. mayb angelfire did some blocking to it. but de strange thing is, it works in de preview page -shrugs- i give up! anywae, thx alot guys & sorry 4 de trouble :)

I don't do javascript... found my suggested solution online.
But I did test it myself using your page source as a local copy and it worked. So... I don't know.

lyk13
27-12-2003, 10:15 PM
Errrr...IniQx, care to give it a shot AGAIN???

<a href="javascript:window.close()">LEAVE NOW!</a>

;)