The JavaScript function does not work on the first page?

advertisements

I have a modal window for the contact form with a link on the sidebar of my site:

<a href="/contact-us/"  onClick="openDialog();return false;" style="color:#e40"><strong>Click to contact us</strong></a>

While it works perfectly on every other pages, it doesn't work on the home page. Try clicking it and it won't open the modal window.

The function openDialog() is defined in global.js:

function openDialog() {
    jQuery("a#inline").trigger('click')
}

I don't know why. And I don't know how to debug JavaScript. It has no errors displayed whatsoever. Can you help me debug this and also let me know how I can debug it myself in future?

Thanks!


Suppose that you are using a kind of wordpress plugin named like "modal dialog". It seems like this plugin not well install on your home page but other pages, so check the plugin setup of all the layouts include the one used by home page.