Dotclear

Vous n'êtes pas identifié(e).

Annonce

13 février 2024 Sortie de Dotclear 2.29

#1 2020-06-14 06:03:00

ben_griffith
Membre
Lieu : Wiltshire
Inscription : 2009-09-28

I can't use target blank in XHTML - Forbidden 403

As soon as I add " onclick="window.open(this.href,'_blank');return false;" to a link, I get "forbidden 403".
First I thought it might be a problem with my browser and deleted the cache/cookies. Then I set up a new blog but still no luck.
I tested my testblog, and it works fine there.
It took some while to realise that the testblog is still in pgsql, whereas the main blog is in mysqli.

The only thing I can imagine is that mysqli doesn't allow this.

Do you have a different term for "open in a new window"? Is the old term out of date?
My PHP version is 7.2 if I use 7.3 I get a database error) and the database seems to use  libmysql - 5.6.43  if that matters.

Thanks in advance.

Dernière modification par ben_griffith (2020-06-16 03:17:44)


I Dotclear.

Hors ligne

#2 2020-06-14 07:29:19

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : I can't use target blank in XHTML - Forbidden 403

Hello. It has nothing to do with database or php version.

I believe you cannot use wiki syntax to do it, but with dcLegacyEditor or dcCKEditor, in code edition mode, you can add the attribute to your link like this :

 <a href="link-url" target="_blank">your link text</a> 

Hors ligne

#3 2020-06-15 04:41:35

ben_griffith
Membre
Lieu : Wiltshire
Inscription : 2009-09-28

Re : I can't use target blank in XHTML - Forbidden 403

Hello Philippe

target="_blank" works.

It was somebody from the Dotclear team many years ago who said I shouldn't use HTML because Dotclear was using XHTML and onclick would be the correct. I have saved since then successfully links with "onclick="window.open(this.href,'_blank');return false;"
As I said, onlick works fine in a postgreSQL blog.

I have 3 blogs:
1. Main blog - MySQLi - user uses XHTML and it doesn't work
2. Test blog - PostgreSL -  user uses XHTML and it works
3. Themeblog - MySLi - the user who used wiki can save, the user wh uses XHTML can't save.

I think it has to do with MySQLi.

Dernière modification par ben_griffith (2020-06-15 05:18:51)


I Dotclear.

Hors ligne

#4 2020-06-15 08:35:27

Franck
Footer de merde
Lieu : Paris
Inscription : 2004-11-09
Site Web

Re : I can't use target blank in XHTML - Forbidden 403

Very weird!

I just tested it, with CKEditor and dcLegacyEditor and everything is running as expected (using PHP 7.4.2 and mySQLi driver which is probably not the problem's origin)


Dotclear addicted since 2004

Hors ligne

#5 2020-06-15 08:56:22

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : I can't use target blank in XHTML - Forbidden 403

ben_griffith a écrit :

It was somebody from the Dotclear team many years ago who said I shouldn't use HTML because Dotclear was using XHTML and onclick would be the correct. I have saved since then successfully links with "onclick="window.open(this.href,'_blank');return false;"

Some time ago (a few years at least), most themes were XHTML 1.0 Strict, where target="_blank" was not allowed. Now, most themes are HTML5, and it is allowed again. That must have been the reason why you were advised to use this bit of javascript instead of the HTML target attribute.

And, unless mistaken, I still believe the type of database is irrelevant

Hors ligne

#6 2020-06-16 03:15:54

ben_griffith
Membre
Lieu : Wiltshire
Inscription : 2009-09-28

Re : I can't use target blank in XHTML - Forbidden 403

Thanks, Phillipe, as long as I have no trouble later on, I will use target blank :-)

Thanks!


I Dotclear.

Hors ligne

Vous n'êtes pas identifié(e).

Pied de page des forums

Sites map