Cito
7 Posts

Hi i want to link to a Bookmarklet in Typesetter.

After safe my source-code

<div style="text-align: left;">Dieses <a href="javascript:alert('Oh!');">Bookmarklet </a>in die Lesezeichensymbolleiste ziehen und fallen lassen</div>

in Typesetter, the link to bookmarlet is empty " "

Any solution?

 

Edited: 3 weeks ago#11545

juergen
1.4K Posts
52.2K Downloads
16 Plugins
design, web development & visual effects

Hi Cito, just try

<div style="text-align: left;">Dieses <a href="" id="#bookmarklet-1">Bookmarklet</a> in die Lesezeichensymbolleiste ziehen und fallen lassen</div>
<script>document.getElementById('bookmarklet-1').href='javascript:alert("Oh!")';</script>

 

Assumed reason:
I believe JavaScript code is removed from the href attribute values (and others) so you can not "infect" your site when you copy HTML-formatted content from the Web to your site.
The clipboard may contain various types of content, e.g. Plain text, images, RTF [, etc.], and also HTML.
Fortunately, it is smart enough to omit <script> sections of HTML content when domain boundaries get crossed. However, since attribute values are not filtered automatically, Typesetter (or CKeditor) takes over.

Edited: 3 weeks ago#11546

Cito
7 Posts

Hi juergen,

thanks for answer, i tryed your code, but it also does not work. Maybe any other suggestions?

3 weeks ago#11547

juergen
1.4K Posts
52.2K Downloads
16 Plugins
design, web development & visual effects

does not work

Funnily, it works here. Have you checked the browser console for JS errors (typos, syntax)?
It should actually work.

 

3 weeks ago#11548

juergen
1.4K Posts
52.2K Downloads
16 Plugins
design, web development & visual effects

... for typos?

Especially for MY typos:

<div style="text-align: left;">
  Dieses <a href="" id="#bookmarklet-1">Bookmarklet</a>
  in die Lesezeichensymbolleiste ziehen und fallen lassen
</div>
<script>
  document.getElementById('bookmarklet-1').href='javascript:alert("Oh!")';
</script>

-->

<div style="text-align: left;">
  Dieses <a href="" id="bookmarklet-1">Bookmarklet</a>
  in die Lesezeichensymbolleiste ziehen und fallen lassen
</div> 
<script>
  document.getElementById('bookmarklet-1').href='javascript:alert("Oh!")';
</script>
Edited: 3 weeks ago#11549

Cito
7 Posts

Hi Juergen, thanks your last code works! But it does not work if Bookmarklet for example is

<div style="text-align: left;"> Dieses <a href="" id="bookmarklet-1">Bookmarklet</a> in die Lesezeichensymbolleiste ziehen und fallen lassen </div> <script> document.getElementById('bookmarklet-1').href='javascript:location.href='https://webcache.googleusercontent.com/search?q=cache:'+window.location.href'; </script>

Do you have also a solution for this?

BTW: how to paste code inside here in this Forum in this editor?

3 weeks ago#11550

juergen
1.4K Posts
52.2K Downloads
16 Plugins
design, web development & visual effects

That's a delimiter collision - e.g. use double quotes to delimit strings inside a  single quoted string…

<div style="text-align: left;">
  Dieses <a href="" id="bookmarklet-1">Bookmarklet</a> in die Lesezeichensymbolleiste ziehen und fallen lassen
</div>
<script>
  document.getElementById('bookmarklet-1').href='javascript:location.href="https://webcache.googleusercontent.com/search?q=cache:"+window.location.href';
</script>

BTW: how to paste code inside here in this Forum in this editor?

Use the 'Formatted' option from the 'Format' dropdown list (Normal, Heading 1, Heading 2, … Formatted)

 

3 weeks ago#11551

Cito
7 Posts
Thank you very much. Works like a charm ;)
Edited: 3 weeks ago#11552


 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register