• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

FCKeditor plugin. Truncated script.

Hi All,

The following forms part of the FCK editor Plugin for an image insert tool. I ahve the follwong script lines which are causing problems;

MyTag22 = "var iLink = document.createElement('a');iLink.href='"+JSimagePath+"Large/"+FileName+"';iLink.rel='lightbox';myLightbox.start(iLink);"

if(JSisIcon == 1)
FCK.InsertHtml("<img class='"+CssTG+"' alt='"+AltTagTG+"' src='"+JSimagePath+FileName+"' onclick='"+MyTag22+"' />") ;
FCK.InsertHtml("<IMG class='"+CssTG+"' alt='"+AltTagTG+"' src='"+JSimagePath+FileName+"'/>") ;

The image is being inserted however the 'onclick=' is truncated and is missing lots. Here is the source of what is rendered:

<img class="WB_ImgRight" onclick="var iLink = document.createElement(" alt="yyyyyyyyyyyy" src="http://localhost/A_Box_V01/Local_IMG_Pallet/babstract.jpg" />

AS you can see the onclick is trucated as soon as it hits the first '

Any ideas

Kind regards

Abiel de Groot
Abiel de Groot
  • 2
1 Solution
you have give a local link.
have you uploaded the site and the fckeditor to a site on the internet?
did you configure the fck path?
Abiel de GrootDeveloperAuthor Commented:
Its running locally... The image insert has been working for years... I am now trying to add alightbox tool to this.

Currently the lines I gave above do insert the image... its just the onclick() that is truncated... don't know why.

You're mixing and matching " and ' too much.  This should fix it:
            FCK.InsertHtml("<img class='" + CssTG + "' alt='" + AltTagTG + "' src='" + JSimagePath + FileName + "' onclick=\"" + MyTag22 + "\" />");
Abiel de GrootDeveloperAuthor Commented:
many thaks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now