Tag: safari extension

一个框架内的jQuery访问表

我有一个问题。 我想在框架内选择一个元素(而不是iframe)。 框架的名称是主要的,但我不能添加ID(很难解释,但不可能)。 如何操作该框架内的数据? 我已经尝试了各种不同的东西(也来自stackoverflow),但它们没有用… 渡渡鸟 框架: jQuery代码 $(document.createElement(“tr”)) .attr({ id: ‘DMbalk’ }) .appendTo($(‘frame[name=main] #header_info tbody’)); 我不能让它以这种方式工作…… game.php代码(主框架)…… dododedodonl Uitloggen Forum Hulp Instellingen Premium Ranglijst (5602.|162 P) Stam Berichten Mededelingen Vrienden Overzichten Kaart dododedodonl(484|175) C14 1229  1229  1229  1229 126/386 噢,我忘了说,这是一个狩猎扩展…

从Safari扩展注入jQuery到网页

我只是想从一个safari扩展中将jQuery注入一个网页。 但仅限于某些页面,因为将jQuery添加为start- / endscript会将其注入所有页面,这会使浏览速度变慢。 我通过使用onload函数创建脚本标记来尝试它: var node = document.createElement(‘script’); node.onload = function(){ initjquerycheck(function($) { dosomethingusingjQuery($); }); }; node.async = “async”; node.type = “text/javascript”; node.src = “https://code.jquery.com/jquery-2.0.3.min.js”; document.getElementsByTagName(‘head’)[0].appendChild(node); 检查是否加载了jquery我使用: initjquerycheck: function(callback) { if(typeof(jQuery) != ‘undefined’){ callback(jQuery); }else { window.setTimeout(function() { initjquerycheck(callback); }, 100); } } 但是typeof(jQuery)仍未定义。 (使用console.log()检查)。 只有从调试控制台调用console.log(typeof(jQuery)),它才会返回’function’。 任何想法如何解决? 提前致谢!