In Visualforce pages, is it possible to use the command line in the Firebug console?

与世无争的帅哥 提交于 2020-01-24 20:43:07

问题


On Visualforce pages, commands run in the Firebug console command line don't seem to work. For example $(".myClass").show(); returns TypeError: $(".moreInfo") is null.

I think this is because the Visualforce is all inside an iframe, so my jQuery is included inside the iframe and all the elements I'm trying to select are also inside this iframe. I'm looking for a workaround if anyone knows of one.


回答1:


If the user viewing the Visualforce page is in development mode, the Visualforce page will be displayed in an IFRAME.

So try disabling "development mode" on your user's User Detail Page.

Søren




回答2:


I've always found when using jQuery with VisualForce that it's best to use jQuery.noConflict() when the page loads and then reference it via jQuery() as opposed to $() thereafter.

I've just tried using both $(xx) and jQuery(xx) in the console — the former shows the same error you're seeing, the latter works correctly.

Matt



来源:https://stackoverflow.com/questions/7357557/in-visualforce-pages-is-it-possible-to-use-the-command-line-in-the-firebug-cons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!