Jump to content

[SOLVED] Hyperlink Ajax Onclick Bookmark Question


sKunKbad

Recommended Posts

I'm using hyperlinks with onclick events to change the page contents. The hyperlinks have onclick events that call the php/mysql content that fills the content div of the page. I was under the impression that since there was an onlick event in my hyperlink that the onclick would take precidence over actual href. I need to be able to have the links in href so that people can bookmark the actual page views. How can this be done?

Link to comment
Share on other sites

Once again I solved my own question by looking at code from around the net somewhere. If you have hyperlinks that are using the onclick event, the proper format for the hyperlink is as follows:

 

<a href='javascript:;' onclick='yourAjaxFunction();'>Click me</a>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.