javascript - link tag calling js function don't work -
i have static site classic menu like: home, services, contact etc links. what i'm trying reducing site's size. so, instead of using multiple pages links (like home.html, services.html) i'm trying keep 1 page , (when clicking occurs) dynamically change content.
html code (sample):
<a href="javascript:this.location.reload()" onclick="contactclick();">contact</a> <h1>old text</h1> js code:
function contactclick() { $('h1').html('new text change, doesnt work, yay!'); } something funny happens. if click on link, 'old text' becomes indeed 'new text', 1 second! , then, changes right 'old text'!
i have tryied calling this: <a href="javascript:contactclick();"> , works fine, still need refresh page when click event occurs (i have color changing stuff on site, lol).
- is there way reduce site's size, or idea fine? or
- is there solve including refreshing site , calling js junction link?
perhaps shouldn't reloading page in href.
Comments
Post a Comment