• Home
  • About
  • Links
  • Contact
  • Imprint
Blue Orange Green Pink Purple

jQuery sortable with Iframes in FireFox

Posted in javascript, jquery. on Sunday, November 15th, 2009 by Chris Tags: javascript, jquery
Nov 15

I came across this problem a week ago when I tried to develop an interface between an Iframe, or in Detail it’s content, and the iframes parent page. Turns out that the following code wouldn´t work in FireFox although all other browsers, yes even our friend the Internet Explorer, would behave as expected.

   function accessIframeJS(IframeName, methodName, methodParams)
   {
    var  IFrameObj  = window.frames[IframeName];
    var  methodCall = "IFrameObj."+methodName+"("+ methodParams +")";

    try{
       eval(methodCall);
    }catch(error){
       // some code here for error handling
    }
   }

Traced on Firebug it turns out that FireFox loses the IFrameObj on Drag & Drop while rewriting the DOM. Took me quite a while, and a long talk with uncle google until I took a look at bugzilla of mozzilla and the huge amount of iframe Bugs mentioned there. But I found the solution after reading alot of those posts,.. and yes as all ways it is an easy one, if you knew the solution.

function accessIframeJS(iframeId, methodName, methodParams)
 {
  var IFrameObj = document.getElementById(iframeId).contentWindow;
  var methodCall = "IFrameObj."+methodName+"("+ methodParams +")";

  try{
     eval(methodCall);
  }catch(error){
     // some code here for error handling
  }
 }

Ta ta,… this works everywhere,… but it took me a long search, until I found the post in Bugzilla.

1 Comment

  1. Dominique Stender on November 17th, 2009

    Ha, I’m glad you found the solution. Sorry I wasn’t much help :)



Leave a Reply

You must be logged in to post a comment.

SwiftLizard Interactive {Design, Development}

  • Last Posts
    • Scrum Master
    • Loging into a page on shell with curl
    • Developing a clock in Flash with AS3
    • Javascript leashed with google Caja
    • Sometimes I wonder about Developers
  • Categories
    • css (1)
    • design (2)
    • development (2)
    • javascript (4)
    • jquery (3)
    • php (4)
    • project management (2)
    • scrum (2)
    • shell (1)
    • thoughts (7)
    • typo3 (3)
    • xhtml (1)
    • Zend Framework (1)
  • Tags
    actionscript 3.0 agile agile development caja continuous integration css design development Flash Flashbuilder javascript jquery Lean OpenAgile performance optimization php product design qunit scrum security shell sql thoughts typo3 xhtml zend zendFramework
  • Friends Blogs
    • Dmitry Dulepov Blog
    • Dominique Stender
    • Gina Steiners Blog
    • Iphone Fan by Dirk Kunde
    • Mario Rimann Blog
    • Michi Zepernick
    • Thomas Hempel :: Typo3 Unleashed
  • Archives
    • March 2010
    • December 2009
    • November 2009
  • Search


  • t3n Social News bookmark at mister wong publish in twitter bookmark at del.icio.us bookmark at digg.com bookmark at furl.net bookmark at linksilo.de bookmark at reddit.com bookmark at spurl.net bookmark at technorati.com bookmark at google.com bookmark at yahoo.com bookmark at facebook.com bookmark at stumbleupon.com bookmark at propeller.com bookmark at newsvine.com bookmark at jumptags.com

RSS Feed


  • Home
  • About
  • Links
  • Contact
  • Imprint

© Copyright SwiftLizard Interactive {Design, Development}. All rights reserved.
Designed by FTL Wordpress Themes brought to you by Smashing Magazine

Back to Top