我正在尝试根据位置和类别搜索专业人士。搜索栏正在过滤结果,但问题是当过滤后显示结果时,此结果将显示在链接中。当我点击链接中显示的结果时,链接无法正常工作。此链接不会重定向给定路径上的页面。我该如何解决这个问题?
以下是我的视图文件的代码:
var pdf = newDoc.getAs('application/pdf').getBytes();
var attach = {fileName:'test.pdf',content:pdf, mimeType:'application/pdf'};
var mailjetparams = {
"Messages":[{
"From": {"Email": 'sender@domain.com',"Name": 'Robert'},
"To": [{"Email": 'reciever@domain.com'}],
"Subject": 'subject',
"HTMLPart": 'this message',
"Attachments": [attach]
}]
}
以下是此视图文件的javascript: 在这里我也使用ajax和keyup方法来显示过滤结果。
<section class="search">
<div class="wrapper">
<div class="container-fluid my_searchbar">
<div class="container my_searchbar_container">
<div class="nav nav-justified navbar-search navbar-nav">
<form class="search navbar-search" method="post" action="index.html" >
<div class="input-group">
<input type="text" name="search_area" id="search_area" placeholder="Search Area" class="form-control input-lg">
<input type="text" name="search_pro" id="search_pro" placeholder="Search Professional Category" class="form-control input-lg">
<ul id="show_search_pro" class="results" >
</ul>
<div class="input-group-btn">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
这是我的控制器的代码:
$('#search_pro').keyup(function(){
var location_field = $('#search_area');
var search_cal_field = $(this);
$.ajax({
type: 'POST',
url: 'http://localhost/JustClick/User/search_professional',
cache : false,
dataType : 'html',
data :{
location_id:location_field.val(),
category_id:search_cal_field.val()
},
success:function(data){
$('#show_search_pro').html(data);
}
});
});