You are here:  » javascript problem and question

Support Forum



javascript problem and question

Submitted by don_load on Wed, 2010-02-24 17:42 in

I've got $config_useJavaScript set to TRUE but the status bar isn't displaying as it should. It's not doing it on your demo site either so it may be a browser issue? Tried it on FF3.5 and IE8 and all I get is the jump.php type link. Any ideas?

Also, what does javascript_focus("search.q") do?

thanks,
Jay

Submitted by support on Wed, 2010-02-24 17:46

Hi Jay,

The focus statement is intended to give focus to the search box on page load. I'll check out the status bar JavaScript first thing tomorrow and get back to you on that...

Cheers!
David.

Submitted by koen on Sat, 2011-12-10 15:00

Hi David,

I'm facing the same Javascript problem as Jay described above. Did you manage to get it reproduced and fixed?

Thanks,
Koen

Submitted by support on Sun, 2011-12-11 20:18

Hi koen

Using an id and getElementById() did the trick. In includes/javascript.php look for the following code at line 8:

return "<script type='text/javascript'>document.".$element.".focus();</script>";

....and REPLACE with:

return "<script type='text/javascript'>document.getElementById('".$element."').focus();</script>";

Finally, in index.php look for the following code that triggers the focus action (line 30 in the distribution)

  print javascript_focus("search.q");

...and REPLACE with:

  print javascript_focus("q");

Cheers,
David.
--
PriceTapestry.com

Submitted by koen on Sun, 2011-12-11 20:29

Thanks David!

But... does this fix the statusbar problem? ;-)

Cheers,
Koen

Submitted by support on Sun, 2011-12-11 21:00

Hi Koen,

All current generation browsers have actually stopped supporting window.status i'm afraid for security reasons - it can normally be enabled via preferences but not by default...

Cheers,
David.
--
PriceTapestry.com

Submitted by koen on Mon, 2011-12-12 21:52

Ahaaa, thanks a lot for this clarification!
Cheers,
Koen