Page 1 of 1

wym stripping out target="_blank"

PostPosted: Wed Oct 10, 2007 8:59 am
by alfrombrum
Hi,

Great work on wym. One problem I've found is that if I try to add target="_blank" to a link tag, wym strips it out, even though this is valid XHTML.

Is there a way to stop this happening, or to make a link open in a new window?

Thanks,
Al

PostPosted: Mon Oct 15, 2007 10:57 am
by jfh
Using target attribute is not valid XHTML strict.
Anyway, you can for example use jQuery in your live web pages to add the attribute.

try this

PostPosted: Fri Dec 14, 2007 9:11 pm
by Al
Sorry for my english,
this my solution :

you need to add/insert :
- line 366 :
Code: Select all
targetSelector:    ".wym_target",

- insert after line 457 : (dialog link)
Code: Select all
+ "<div class='row'>"
+ "<label>Target</label>"
+ "<input type='checkbox' class='wym_target' size='40' /> New window"
+ "</div>"

- insert after line 1325 (into : if(link){...) if the checkbox is checked :
Code: Select all
if(jQuery(wym._options.targetSelector).attr("checked")==true){
   link.attr("onclick", "window.open(this.href);return false;");
}else {
   link.removeAttr("onclick");
}

- insert after line 1294 (into : if(selected){... to check the checkox into the link dialog when the target exist

Code: Select all
if(jQuery(selected).attr("onclick")){
   jQuery(wym._options.targetSelector).attr("checked","checked");
}


_____
Pour que l'attribut target="_blank" passe le W3C, il faut remplacer par un onclick="window.open(this.href);return false;"

Re: wym stripping out target="_blank"

PostPosted: Fri Oct 15, 2010 7:56 am
by Esie
Hi,.guys...i am new in this site,..can you please sent me,..
some info and detail??
thanks in advance,...



cheers,
how to deal with depression