?
Solved

FCKeditor plugin. Truncated script.

Posted on 2009-07-06
4
Medium Priority
?
242 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

762 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