Asp.NET應用thickbox.js傳遞參數,後台請求不到的問題

來源:互聯網
上載者:User
  最近有個項目想利用thickbox.js做出快顯視窗的特效,而希望可以動態顯示iframe中的內容,但最後發現在asp.net後台無法請求到thickbox.js的參數,鬱悶了一點時間,感覺十再想不通.都是href傳遞過去的參數為什麼不加 class="thickbox"就可以請求到參數,加了這個就請求不到參數,當然不加的話就沒特效了,最後想一定是在thickbox.js代碼屏蔽了,不然沒理由請求不到參數的,開啟thickbox.js,很快發現是讓如下代碼屏蔽了
  if(url.indexOf('TB_iframe') != -1){    
     urlNoQuery = url.substr(0,TB_strpos(url, "?"));   
     $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a></div></div><iframe src='"+urlNoQuery +"' id='TB_iframeContent' style='width:"+(ajaxContentW + 30)+"px;height:"+(ajaxContentH + 18)+"px;'></iframe>");
    }else{
     $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");
   }
就因為urlNoQuery 所以參數全部就取掉了.所以就把urlNoQuery 改成了url,當然是改這句話的 $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a></div></div><iframe src='"+urlNoQuery +"' id='TB_iframeContent' style='width:"+(ajaxContentW + 30)+"px;height:"+(ajaxContentH + 18)+"px;'></iframe>");
改成如上代碼後,運行測試,哇哈哈哈哈哈...成功可以請求到資料了,目標實現!嘻嘻!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.