If you copied the jquery code for the pop-up from somewhere on the internet then it probably uses the $ character to reference the jQuery object. However this is not supported in WordPress. You can check if this is the problem by opening your browsers JS console (right click on the page > Inspect Element > Console) and reloading the page. This might reveal the error.
If this turns out to be the problem then you should try replacing all the $ characters in that code with the word jQuery. The code might start working.
Thanks for responding. I suppose I could have included the code, sorry. I don’t see the $ but of course there could be something else.
Here is the code:
In head tags:
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
In body
<A HREF="index.html"
onClick="return popup(this, 'notes')">Link to pop up</A>
This is sample of it working fine on my regular website http://themetalpeddler.com/test.html
Can I see the WordPress page where you are trying to use this?
Sure – I am just doing it as a test page for now
http://themodernpioneer.com/test/
The link ignore the script and is just a regular link.
I don’t see the onclick part in the source code of this page.
It just strips it out. I paste it in, save, publish and when I go back in, it’s gone. 🙁
That’s the problem. You can avoid using the onclick thing in the HTML of your post by using javascript’s click event handler.
Might try editing your profile and disabling the visual editor. Then try and add the code and publish.
Disabling the visual editor causes it to leave the code alone better.
Not sure what the click event handler is?
I was try disabling visual editor, too. Thanks.