Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

It works but shows as error on error console ???

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I have
Code:
<script type="text/javascript">
shortcut("Alt+O",function() {
	window.location = "[URL unfurl="true"]http://www.some_site_name.com/administrator/login.aspx"[/URL]
});

</script>

As I load the page, my error console shows an error saying that shortcut is not defined; yet, if I press Alt+O page toggles without a problem.

What gives?



--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Remove the code entirely. Then see if your shortcut still works. It's certainly not a built-in feature of Javascript to allow you to create shortcuts like that. Maybe you are loading some other code as well (and it's a timing issue)?

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top