让我们来看看jQuery在引擎下!可以看到在下面的代码片段中,最先进的代码在这个插件执行超过404的部分处理。因为我们连接到第三方网站(雅虎)来访问这个URL,将有一两秒钟的等待在我们的查询,这是如此有效的URL以及那些不是。以确保用户知道什么回事可以有用的页面上显示一个进度叠加与标签的检查URL状态. .”或类似的东西。function performAjaxCall(url,msg,container) { if(url.match('^http')){ msg.html(' (checking...)'); //connect to yahoo YQL to get a response for the URL $.getJSON("http://query.yahooapis.com/v1/public/yql?"+ "q=select * from html where url=""+ encodeURIComponent(url)+ ""&format=xml'&callback=?", function(data){ if(data.results[0]){ var data = filterData(data.results[0]); //if the url passes the test, navigate to it donav(url); } else { msg.html(' (404!)'); //otherwise display the modal error window fourPop(); } } ); }现在我们定义我们的模态窗口函数如下:function fourPop(){ var popWidth = 500; //dim[0].split('=')[1]; var popID = '404message'; $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend(''); var popMargTop = ($('#' + popID).height() + 80) / 2; var popMargLeft = ($('#' + popID).width() + 80) / 2; //Apply Margin to Popup $('#' + popID).css({ 'margin-top' : -popMargTop, 'margin-left' : -popMargLeft }); //Fade in Background $('body').append('
文件目录······
暂无数据
猜你喜欢
更多»
项目推荐
更多»
PDF电子书
更多»
Java多线程编程核心技术
(2)
Linux命令详解词典.pdf
(5)
深入Python3中文版
(0)
百度SEO一本通.pdf
(0)
mysql必知必会.pdf
(2)
疯狂JAVA讲义 pdf电子书
(3)
C# 图解教程pdf电子书
(3)
研磨设计模式 pdf电子书
(0)