Solved

FCKeditor plugin. Truncated script.

Posted on 2009-07-06
4
240 Views
Last Modified: 2012-05-07
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+"' />") ;
}
else
{
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

A.
0
Comment
Question by:Abiel de Groot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 29

Expert Comment

by:chilternPC
ID: 24785448
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?
0
 
LVL 5

Author Comment

by:Abiel de Groot
ID: 24785490
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.

A.
0
 
LVL 15

Accepted Solution

by:
crisco96 earned 500 total points
ID: 24785667
You're mixing and matching " and ' too much.  This should fix it:
            FCK.InsertHtml("<img class='" + CssTG + "' alt='" + AltTagTG + "' src='" + JSimagePath + FileName + "' onclick=\"" + MyTag22 + "\" />");
0
 
LVL 5

Author Closing Comment

by:Abiel de Groot
ID: 31600175
many thaks
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question