firebug errors with "updatefile is not defined"

After installing livecoverage and visiting "liveupdate/live" I receive this error. It does not seem to affect subsequent calls.

var updatefile is being placed via inline js, which can cause problems. A better method is to drupal_add_js('setting', $settings) after you add your js.

Attached is a patch without inline js.

It also removes the hook_init() in favor of including the js and css only on pages with node_view && livecoverage, and it works for me but I may not have the complete implications of my actions in mind :)

Comments

jonskulski’s picture

Status: Active » Needs review
jonskulski’s picture

Title: js error: » On page load, js error: "updatefile is not defined"
kevin hankens’s picture

StatusFileSize
new2.04 KB

Yeah, that works perfectly. I was never happy about the inline JS and somehow missed the 'setting' option

Here's a /slightly/ revised patch for livecoverage.module to include some comments, etc.

kevin hankens’s picture

StatusFileSize
new885 bytes

-EDIT- Do not use this patch, instead use the following patch: livecoverage-388854-5.patch
Here is the livecoverage.js patch to use the Drupal.settings variables

kevin hankens’s picture

StatusFileSize
new834 bytes

Oops, that patch still included an alert() for debugging. Here's a new patch for the JS file.

kevin hankens’s picture

Status: Needs review » Closed (fixed)

Patches committed.