Jump to content


Photo

JavaScript and BUTTON


  • Please log in to reply
3 replies to this topic

#1 AndieB

AndieB
  • Members
  • PipPipPip
  • Advanced Member
  • 77 posts
  • LocationSweden
  • Age:37

Posted 23 August 2006 - 07:12 AM

Hi all GURUs!


I would like to create a BUTTON with the <button></button> HTML code.
In this <button> I'd like to add onClick function with the Javascript function to load a new page. I do not want to use the <A HREF> functionality.

I think it would look something like this:
<button onClick="javascript:[b]the code I don't know[/b]" >click here to go on</button>

What is the javascript code I'm after?

Thank you all in advance for any kind of help!

--Andreas
" Start by looking in the mirror before pointing the finger outwards... "
" Nothing can be, until it has passed your mind... "

#2 GBS

GBS
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 23 August 2006 - 08:41 AM

Hi,

maybe try to do something like:

<button onClick="javascript:testing()" >click here to go on</button>

& the javascript part could be:
function testing()
{
window.open("your_page.html","the_page","width=310,height=400,left=320,top=0");
}
hoping it helps,

l8tr,,
Sorry for my english,... I do my best, but sometimes,...
1st intention: understand the problem
2nd intention: try to solve it
3rd intention: try to understand how to solve it :)

#3 radalin

radalin
  • Members
  • PipPipPip
  • Advanced Member
  • 179 posts

Posted 23 August 2006 - 11:18 AM

you can also use
window.location = "www.yourlink.com" ;

Roy Simkes
Yet Another Parkyeri Developer

#4 AndieB

AndieB
  • Members
  • PipPipPip
  • Advanced Member
  • 77 posts
  • LocationSweden
  • Age:37

Posted 06 September 2006 - 11:14 AM

Thank you, it worked perfectly!!
" Start by looking in the mirror before pointing the finger outwards... "
" Nothing can be, until it has passed your mind... "




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users