Click here to Skip to main content
15,921,454 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys... I know that javascript and jquery is capable of retrieving the keys that is being type by the user... but i was wondering if we can achieve it the other way around?
I want to send a key to the browser... for example i have an "a" tag and when the user click on that tag it will send to the browser a command as if the user has type that key... for example when they click it my script will run the code like ctrl + a... that way its just like the user has typed in that key which is ctrl +a... i doing this because i want to achieve the bookmarking effect... you see i have a bookmarking script that i just downloaded from the net but the drawback of this is that it wont support on chrome. so i thought that why not if the user click on the bookmark link on chrome my script will sent a command to the browser of ctrl + d command that is equivalent for bookmarking... that way it will support the chrome browser is it doable?
Sergey Alexandrovich Kryukov 1-Feb-12 20:55pm    
This is dirty programming, nor recommended.
Madzmar25 1-Feb-12 22:41pm    
Actually its not really dirty... I'm just trying to resolve the cross browser issue on the bookmarking functions of jquery... since jquery bookmark does not support chrome and safari...
adrian lewis 2-Aug-12 6:44am    
Did you ever work this one out Madzmar25? I just realised I wanted to do exactly the same thing, so searched for it and found your post!
Madzmar25 10-Aug-12 5:00am    
I wasn't able to solve this problem on chrome and safari so i had to stick to the solution of displaying a message saying "press ctr+d or command + d" if the user is using chrome or safari
adrian lewis 10-Aug-12 5:05am    
Yes, I've come to the same decision for the moment - thanks for responding!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900