js template dose'nt work in ie

js template dose'nt work in ie

yuval shafriri發表於
Number of replies: 7
?Why is it no script semms to be working No problem with ff and crome Thanks Yuval Shafriri
評比平均分數: -
In reply to yuval shafriri

Re: js template dose'nt work in ie

Itamar Tzadok發表於

The script may contain something IE doesn't like (there are many such things especially if you develop the script on FF). The browser should indicate an error in the js file. If you have the code in an ide or any editor which shows line numbers you should be able to detect the problem quickly. hth 微笑

In reply to Itamar Tzadok

תשובה ל: Re: js template dose'nt work in ie

yuval shafriri發表於
No NO error in my script. i Have tried also the Script from Moodle Docs. ( I generated syntax Error deliberatly and had an error)
In reply to yuval shafriri

Re: תשובה ל: Re: js template dose'nt work in ie

Itamar Tzadok發表於

Which moodle version? And post the script so that we could take a look. 微笑

In reply to Itamar Tzadok

תשובה ל: "Re: seems to be the use of "innerHTML

yuval shafriri發表於
Hi. i checked at v 2.0 . it Dose Generate An error that mean IE dosent recognise innerHTML property. and maybe also the "getElementsByName" dosent get the element at all.. the script is here: http://docs.moodle.org/en/Database_templates#Javascript_template Thanks a lot.
In reply to yuval shafriri

the error is at the getElementsByNames.. got it

yuval shafriri發表於
it is not the innerHTML. when i use getByTagName it was ok. for my function it is Enough, but not for getting more specific element, so maybe better to specify it at the moodleDocs js-db-template. actually my function is to replace the "hl=en" to "hl=he", in the location field( gmap) at my db activity. (i use it as a teacher so i cannot change it at the server).
In reply to yuval shafriri

Re: the error is at the getElementsByNames.. got it

Itamar Tzadok發表於

If you need to get a specific element in the Add entry template you can use the builtin field id tags (e.g [[Loc#id] ]). For the single or view template you can enclose the field in an identified div or span which you can get by getElementById and than the desired element by getElementByTagName(<tag name>)[0]. 微笑

In reply to Itamar Tzadok

תשובה ל: Re: the error is at the getElementsByNames.. got it

yuval shafriri發表於
Thanks Hope some day they will goin us (to a unified compatible browser)