Solved

FCKeditor plugin. Truncated script.

Posted on 2009-07-06
4
226 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
  • 2
4 Comments
 
LVL 28

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now