Home Forums Travel WordPress Theme Reply to ben0ist

This topic contains 0 replies, has 1 voice, and was last updated by  Johnny 3 years, 3 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #3106

    Johnny
    Participant

    ben0ist:
    Hi, I added a link to another site in my menu. In order to get it opening in a new tab I changed:

    window.location.href=this.href; by window.open( this.href, ‘_blank’);

    in the main.js file. (also added no ajax + ticked open in a new tab)

    It’s now opening in a new window, but an error message appears on the main site: “Perhaps the network unstable, please click refresh page.” Do you know how to avoid this error? Thx

    Hi, assuming you want the menu item click forward to ‘http://google.com’, open travel/js/main.js and find this line:

    `if(jQuery(this).attr(“act”) == “noajax”) {
    window.location.href=this.href;
    }`
    update it with:

    if(jQuery(this).attr('href') =='http://google.com'){
                            window.open( jQuery(this).attr('href'), '_blank');return false;
                        }
    					if(jQuery(this).attr("act") == "noajax") {
    						window.location.href=this.href;
    					}

    Best

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.