anuradhaspidy / widgeditor

Automatically exported from code.google.com/p/widgeditor
0 stars 0 forks source link

Doesn't load using Ajax.Updater calls #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When calling a textarea using Ajax such as Prototype Ajax.Updater, the 
widgeditor doesn't load.

See this example: http://www.visitor-stats.com/widgeditor/

All I get is a blank textarea. It works fine in the main HTML, just not when 
loading via the Ajax call.

Tested in Safari 3.1, Firefox 2, Camino.

Have tried calling the Widgeditor files and CSS from the Ajax loaded file too, 
still does not work.

Using version1.1, but also have tried in v1.

Original issue reported on code.google.com by evolvedw...@gmail.com on 1 Apr 2008 at 4:35

Attachments:

GoogleCodeExporter commented 9 years ago
widgInit only gets run at window.onload (by default). Call widgInit in your 
AJAX onsuccess function.

Original comment by texanpen...@gmail.com on 11 Apr 2008 at 1:59

GoogleCodeExporter commented 9 years ago
Thanks, this didn't work in my case, but I did get it working by calling 
widgInit() from inside my ajax-loaded 
div.

  // load div
  new Ajax.Updater('mycontent', url, {asynchronous:true, evalScripts:true});

<div id="mycontent">
  <h2>Hi, stuff goes here</h2>
  <textarea name="text" id="my_textbox" rows="10" cols="10" class="widgEditor">My content... edit 
away!</textarea>
  <script type="text/javascript">
    widgInit();
  </script>
</div>

Original comment by yari.mcg...@gmail.com on 23 Apr 2008 at 11:20