PDA

View Full Version : JScript compatibility errors with new OCD v6.0.4.1



Gagliem
11-23-2006, 10:03 AM
With the new version of OCD v6.0.4.10714 one of my JavaScript functions in my theme, which assign authors to a track with this display

TrackName: (Name/Name1: Authors; Name2: producer; etc.)

gets a JS error when the variable gets the trackname in this form

VarTNAME = ("<dax:tracktitle/>")

now this happens when a track name has double quotes like U2's "40" and I cannot use

VarTNAME = ('<dax:tracktitle/>')

because of titles like U2's 11 O'Clock Tick Tock.

THIS DIDN'T HAPPEN WITH PREVIOUS VERSIONS of OCD, it happened only with <dax:membername/>, <dax:guestname/> while other
fields like <dax:trackrecordingcity/> and <dax:tracktitle/> seemed parsed by OCD before being stored in Javascript variables (<dax:trackrecordingcity/> still works fine).

To be sure I've installed again OCD v6.0.3.10631 and my theme worked fine again.

Andrei, please can you tell me another way to gets tags data without getting error if they contain single or double quotes or both (I won't use /symbols in the text field in order to get my DBase compliant with other themes)?

Or can you parse again <dax:tracktitle/> like previous versions of OCD and fix also <dax:membername/> and <dax:guestname/> the same way (I have commented some of my JS functions because of this behaviour)?

Thanks
Emanuele

andrei_c
11-25-2006, 07:02 AM
Hi Emanuele,

I fixed tracktitle, credits and some other occurences of this problem that I found. The fix may be not what you expect, so please read on. The change will go into next update.

The updated code will generate &amp;quot; instead of double quote, but the single quote will remain intact, so correct usage would be this:

VarTNAME = ("<dax:tracktitle/>")

NOT this:

VarTNAME = ('<dax:tracktitle/>') INCORRECT - will generate error if single quote occurs in the title!

Also, you will need to decode &amp;quot; &amp;lt; and &amp;gt; if you plan to use this data for any purpose besides displaying it in the page.

Andrei

Gagliem
11-27-2006, 09:59 AM
Ok, thanks Andrei.
I'll wait for the next release and I'll check the changes on my template.

Cheers
Emanuele