
نوشته اصلی توسط
ms313
از تابع redirect یا window.location استفاده کنید.
یه نمونه سمپل ساده
کد HTML:
$(document).ready(function(){
jQuery.ajax({
type: "GET",
url: "populateData.htm",
dataType:"json",
data:"userId=SampleUser",
success:function(response){
if (response.redirect) {
window.location.href = response.redirect;
}
else {
// Process the expected results...
}
},
error: function(xhr, textStatus, errorThrown) {
alert('Error! Status = ' + xhr.status);
}
});
});
متاسفانه نتونستم با کد فوق کار کنم... لطفا بیشتر توضیح بدید... با سپاس
کد:
<form action="" method="POST">
<input name="username" id="username" type="text" class="input" value="" onClick="click1('username')" />
<input name="password" id="password" type="password" class="input" value="" onClick="click1('password')" />
<input id="but1" type="submit" value="ورود به پنل"/>
</form>
کد html فرم ورود