Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top