In Visualforce pages, is it possible to use the co

2019-08-01 19:37发布

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.

2条回答
相关推荐>>
2楼-- · 2019-08-01 19:47

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

查看更多
smile是对你的礼貌
3楼-- · 2019-08-01 20:04

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

查看更多
登录 后发表回答