I have this code here:
<script type="text/javascript">
function goFunction(){
history.pushState("google.ca", "GOOGLE CANADA", "http://www.google.ca");
return event.preventDefault();
}
</script>
and
<a href="#" onclick="javascript:goFunction();">GO</a>
when I click on my link, I get this error in my error log:
Uncaught SecurityError: A history state object with URL 'http://www.google.ca/' cannot be created in a document with origin 'http://cowelllaserhair.com'.
you can see this at: http://cowelllaserhair.com/test.html
What am I doing wrong?
Do I need to reference something?
Thanks,
J
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…