Привет, люди, у меня есть этот jquery, который звонит на страницу, чтобы вставить письмо в список новостей.
вызов вызывается дважды, URL имеют странный параметр _, который я не добавил, два URL, которые вызываются одним щелчком мыши
:
http://www.camerich.co.uk/newsletter_add.php?emailtoadd=meeny@dizzyhigh.com&_=1310316941893
http://www.camerich.co.uk/newsletter_add.php?emailtoadd=meeny@dizzyhigh.com&_=1310316941906
как мне остановить дублирование вызова ???
Jquerycode:
$('.searchbox_submit').click(function() { // start the click function for news_submit div
// get the email address that has been entered
var emailtoadd = $("#emailtoadd").val();
// set the url to load
var loadUrl = "newsletter_add.php?emailtoadd="+emailtoadd;
// set the status to let the user know we are loading in the data
$("#newsresponse").empty().html('<img src="/images/site/loadinfo.gif" width="16" height="16" align="absbottom" /> Processing Request...');
//load in the data
$.get(loadUrl, {}, function(myData) {
// add the response to the newsresponse div
$("#newsresponse").empty().html(myData);
}); // end get request
});//end click function
HTML код:
<div class="iconthumbs" style="background-image:url(images/icons/smaller/subscribe_button.jpg)">
<div id="searchwrapper" name="searchForm">
<div class="errortxt" id="newsresponse" style="padding:0 0 0 15px;"></div>
<input type="text" class="searchbox" name="emailtoadd" id="emailtoadd" style="color: #FFF" onClick="this.value='';" onFocus="this.select()" onBlur="this.value=!this.value?'Enter Email To Subscribe':this.value;" value="Enter Email To Subscribe" />
<input type="image" src="/images/site/1px.gif" class="searchbox_submit" id="news_submit" value="" />
</div>
</div>