ASP. NET app thickbox. js transmits parameters, and the background request is not available

Source: Internet
Author: User
Recently, a project wants to use thickbox. JS makes a pop-up window effect, and hopes to dynamically display the content in IFRAME, but finally finds that thickbox cannot be requested in the Asp.net background. the JS parameters are depressing for a moment, so I can't figure it out again. why can I request a parameter without class = "thickbox" When href passes the previous parameter? If this parameter is added, no parameter is requested. If this parameter is not added, no special effect is required, it must be in thickbox. JS Code Blocked, otherwise there is no reason to request the parameter, open thickbox. JS, and soon find that the following code is blocked
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> <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 id = 'tb _ ajaxcontent 'style = 'width: "+ ajaxcontentw +" PX; Height: "+ ajaxcontenth +" PX; '> </div> ");
}
All parameters are removed because of urlnoquery. therefore, we changed urlnoquery to URL. Of course, we changed $ ("# tb_window") in this sentence "). append ("<Div id = 'tb _ title'> <Div id = 'tb _ ajaxwindowtitle'>" + caption + "</div> <Div id = 'tb _ closeajaxwindow '> <a href =' # 'Id = 'tb _ closewindowbutton'> close </a> </div> <IFRAME src = '"+ urlnoquery +" 'id = 'tb _ iframecontent' style = 'width: "+ (ajaxcontentw + 30) +" PX; Height: "+ (ajaxcontenth + 18) +" PX; '> </iframe> ");
After the code is changed to the above Code, run the test. Wow, haha, haha... the data can be requested successfully and the target is implemented! Hey!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.