I want the code from a href to use window.open.

Asked 5 months ago, Updated 5 months ago, 14 views

Thank you for your continuous support.

We are currently creating an RSS application using the URL below.

■Reference URL

About the 118th line code in the site
If I try to open the link like this, it will open in the app, and if I use ios, I won't be able to go back to the previous page.(_blank didn't work either)

I'd like to change to a code that uses Window.open.
In the case of the code below, how should I correct it?
I want to start Target with "_system".

■ Code you want to change (118th line)

+'<a href="'+entries[l]['link']+'>'+entries[l]['title']+'<a>'

I changed it like this, but it didn't work...

+'<a href="#"onclick="window.open('+entries[l]['link']+','_system')">'+entries[l]['title']+'<a>'

I apologize for the ignorance, but please let me know.

javascript html

2022-09-30 12:00

1 Answers

Because the string is enclosed in a single quotation, \ ( ) mark) is used to start the single quotation.

Also, please refer to this as well.

Enter special characters (escape sequence)

+'<a href="#"onclick="window.open(\"+entries[l]['link']+'\',\'_system\')">'+entries[l]['title']+'<a>'

2022-09-30 12:00

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.