CodeIgniter Forums

Full Version: Jquery problem with .unload
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have the code below that I use to tell my Chrome Extension to go into a special "mode". Here is the code from the view:

<script language="javascript">

   $(document).ready( function() {
       var editorExtensionId = "lamacgnkfoiknjpleghfknfigbmhdaei";
       // unload when done
           chrome.runtime.sendMessage(editorExtensionId, "snapshot_mode_unload",

       // Make a simple request:
       chrome.runtime.sendMessage(editorExtensionId, "snapshot_mode",
           function (response) {
               if (!response.success)



When I comment out the .unload code it seems to run fine. I get the message in the extension and act upon it. However, when I uncomment the .unload code neither  the load message is not being sent nor is the unload message. It just breaks. Any jquery people up here? Also, is there a way to pass in a parameter from my ci controller to the javascript function?
Your missing the last closing )

 chrome.runtime.sendMessage(editorExtensionId, "snapshot_mode_unload",

Should be:

 chrome.runtime.sendMessage(editorExtensionId, "snapshot_mode_unload"),
The following worked:

chrome.runtime.sendMessage(editorExtensionId, "snapshot_mode_unload")