Error in common.js (frajax-iframe)

Error in common.js (frajax-iframe), a forum discussion on Jojo CMS. Join us for more discussions on Error in common.js (frajax-iframe) on our Administration (backend and configuration) forum.

Back to Forum Index : Back to Administration (backend and configuration)   RSS
SoulGlo

20 Apr 2009
Posts: 17

G'day,

I've just loaded the latest from the SNAPS - however I recieve the following error message when ever I try to edit a page, save a setting or try and install a plugin.

Error: document.getElementById("frajax-iframe") is null
Source File: http://localhost:8888/*site*/js/common.js
Line: 38

Any ideas why or how to fix it?

Cheers

David
tom

Developer

tom

21 Apr 2009
Posts: 379

is this a new version of Jojo running a site that used a previous version?

sometimes all that's needed is a full refresh (to rebuild the js file which is cached)

more aggressively, you can delete the whole cache folder and run setup.

occasionally there are also changes made to index.php which necessitate updating the copy in your webdir folder
SoulGlo

21 Apr 2009
Posts: 17

Hey Tom,

Its a fresh install with a template being used from a site using an older version of JoJo..

I've run Setup a few times and deleted the cache folder completely - even though it didn't contain a copy of common.js..

Maybe there is a problem with my MAMP caching the js files and not letting things clear even if I am setting a fresh install up.

Cheers

tom

Developer

tom

21 Apr 2009
Posts: 379

can you browse to /js/common.js ? try a force reload to see if that changes anything, and post the offending line?

does the old template have anything in a js/functions.js ?
SoulGlo

21 Apr 2009
Posts: 17

I can browse to /js/common.js and it is the frajax function that is causing issues..

I haven't done a force refresh - (stupid question, but what is the Mac equivalent of Ctrl-F5?) but I have emptied the browsers cache and installed Firefox thinking it might be an Safari 4 Beta problem...

Not sure if the old template has any js functions - I'm away from my desk at the moment so will check later...
tom

Developer

tom

21 Apr 2009
Posts: 379

Safari 3 doesn't have a force refresh, Safari 4 does something that looks like a force refresh if you hold down shift and click the reload symbol, Firefox Mac is Apple + Shift + R
SoulGlo

21 Apr 2009
Posts: 17

OK - tried the force refresh and still no lovin'.

Safari Web Inspector says that the error is:

'TypeError: Result of expression 'document.getElementById('frajax-iframe')' [null] is not an object.'

and here is the offending line:

function frajax(action,a,b,c,d,e,f,g,h,i,j){var url=siteurl;var r=/(http|https):\/\/.*/;var m=r.exec(window.location);if(m!=null&&m.length>1){if(m[1]=='https'){url=secureurl;}}
url+='/actions/'+action+'.php?';url+='arg1='+encodeURIComponent(a);url+='&arg2='+encodeURIComponent(b);url+='&arg3='+encodeURIComponent(c);url+='&arg4='+encodeURIComponent(d);url+='&arg5='+encodeURIComponent(e);url+='&arg6='+encodeURIComponent(f);url+='&arg7='+encodeURIComponent(g);url+='&arg8='+encodeURIComponent(h);url+='&arg9='+encodeURIComponent(i);url+='&arg10='+encodeURIComponent(j);document.getElementById('frajax-iframe').src=url;return false;}

Could my frajax-iframe be missing? I couldn't find it having a quick look at the html...

Cheers again
Harvey

Core Developer

Harvey

21 Apr 2009
Posts: 327

You should have the following code in the foot of your HTML document...

<iframe src="javascript:false;" name="frajax-iframe" id="frajax-iframe" style="display:none; height: 0; width: 0; border: 0;"></iframe>


Off the top of my head, this is either in foot.tpl in jojo_core, or by a plugin hook (which hooks into foot.tpl)

This feature has been in place since the dawn of time, and hasn't changed for a while. Seems odd that it would suddenly stop functioning. I would make sure your copy of foot.tpl is current, and try manually adding the above iframe code if you don't see this in your HTML output.

Harvey.
SoulGlo

21 Apr 2009
Posts: 17

And that has fixed all the problems!

Thanks again Harvey - I should have picked that up days ago.. Thanks also Tom for your help!
Back to Forum Index : Back to Administration (backend and configuration)   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.