image- assets/rating/star.png的路徑 現在如何給這個路徑在外部js 我也加載了url helper。在Codeigniter:如何給外部js文件中的圖像路徑
$(document).ready(function(){
$("#1_star").hover(function(){
$("#1_star").attr("src","Path for image");
});
});
我做這樣
$(document).ready(function(){
$("#1_star").hover(function(){
$("#1_star").attr("src","<?php echo base_url('assets/rating/star.png');?>");
});
});
你做得對,什麼問題你面對? – TheTom