0

I have this code

<div class="wrap-box-video" id="31">
     <div class="addfav">
     </div>
     <img src="/etc.jpg" />
</div>

and with this code

$(document).ready(function(){
    $("div.addfav").click(function(e){
       window.location = "?wpfpaction=add&postid=" + $(this).parents(".wrap-box-video").attr("id");
   });
});

i want to load the ?wpfpaction=add&postid=31 (in this exemple) but not to show in the url tab i want this to be underground. if i'm on exemple.com page and i click the addfav div i want the exemple.com to be the same but the script to work.

Darshan Patel
  • 2,839
  • 2
  • 25
  • 38

1 Answers1

0

If you're talking about changing what text appears in the browser tab, you can alter the title element of the HTML rendered at you ?wpfaction endpoint.

If you want to change what the actual URL that appears in the URL bar, see Modify the URL without reloading the page

Community
  • 1
  • 1
joeltine
  • 1,610
  • 17
  • 23
  • The `?wpfaction` code adds the respective video to a favorite list. But i want to load this action when the button/div is clicked but not to show in the url or reload/change the page. The respective url to remain the same. –  Aug 09 '14 at 17:00
  • Oh use $.ajax({url: '?wpfaction...'}) instead of window.location = '..' – joeltine Aug 09 '14 at 17:01