Solved

FCKeditor plugin. Truncated script.

Posted on 2009-07-06
4
238 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why is my $_POST not going to results page 10 67
AngularJS: ng-repeat 25 54
HTML editor custom button 3 84
How to strip HTML from this JS code using regex 29 44
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

737 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