close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem with Javascript code in template (Piwik)

Thread began 6/09/2012 2:41 am by neo314 | Last modified 6/09/2012 12:55 pm by neo314 | 810 views | 2 replies |

neo314

Problem with Javascript code in template (Piwik)

Hi all,

I am not sure if this has been reported. I saw some similar issues, but they seemed to be slightly different.

I was trying to add Piwik (Web Analytics Code) to the template which has a line like this:

document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));

That line was being re-written, apparently by framework, to:

document.write(unescape("%3Cscript src='Templates' + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));

I'm not entirely sure why, but this fixes the problem, however it concerns me as a bug that, if I am right about the cause, should be addressed.

This workaround fixes the problem.

document.write(unescape("%3Cscript sr"+"c='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
Sign in to reply to this post

Ray BorduinWebAssist

This is being done by framework builder. The framework builder tries to update any src paths and it assumes the base path is relative to the file it is located in.

Your work around is valid. I'll log this as a bug to see if we can update the code to better recognize this type of script and not update the path in this case.

Sign in to reply to this post

neo314

I don't think framework is the only template mechanism that would be affected by this. I'm not sure how you would better detect which src's to change without negatively impacting one that should be replaced and is not. As you know, I am more concerned that it detect links that are site root relative and not change those (ignore src="/dir/file.php").

I suppose another fix would be to put this code in an external file.

Thanks for looking into it.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...