Wix Help Center

    HTML to open link in new page

    Ticket by dlangpap | May 21, 2014 | Question
    • Hello,

      I've been trying to embed my ecommerce shop in Wix. I have accomplished this by adding external HTML via the "website address" option as opposed to the "HTML code" option. But I need the link that's clicked on the inserted HTML to open in a new window, not in the same frame.

      From the help section, I was able to find: 

      "When you add an HTML app to your site and add custom code to it, the HTML app will load on your site as an iFrame. Any links in that frame will automatically open in that same frame. To resolve this, you can use the target="_blank" attribute and the links will open in a new page."

      My questions:

      1. Can I just copy the code of my site (as displayed by the Chrome "view page source" option) and paste it on the "HTML/ embed code" window as shown in the attached screenshot? Apparently there's a character limit for this option. Would I still have a limit if I updated to premium? 

       

      2. How and where would I insert the " target="_blank" attribute" into this code so that any clicked link will open in a new page? 

      Thanks,

      DL

       

       

    Replies (7)

    • Reply from Ron | May 22, 2014

      Hi,

       

      Keep in mind that by adding external HTML code you are adding products and code that we  have not tested or created in Wix, therefore our support team cannot answer any questions concerning the HTML iFrame/Embed App.

      Ron, Wix Team
    • Reply from dlangpap | May 22, 2014

      Hi Ron and thanks for your answer.

      I believe my questions were Wix related. Let me rephrase them to see if they can be better understood.

      1. I used the option to add HTML via "website address". This worked. Then I tried to add via the  "HTML code" option. This didn't work. Questions: a) Could this be because there's a limit of characters when adding code this way? b) If I had a premium account, would there still be a limit?

      2. I read in the Wix help section: ""When you add an HTML app to your site and add custom code to it, the HTML app will load on your site as an iFrame. Any links in that frame will automatically open in that same frame. To resolve this, you can use the target="_blank" attribute and the links will open in a new page." Question: How and where would I insert the " target="_blank" attribute" into this code so that any clicked link will open in a new page? 

      I hope this makes it clearer.

      Thanks,

      DL

       

    • Reply from dimitry | May 22, 2014

      Hi,

      Please note, as Ron mentioned, unfortunately, we cannot support external code, but we recommend testing your code externally.

      You can do this using sites such as the following:
      w3schools.com
      jsfiddle.net

       

      Also note that the target="_blank" can be added only when using the HTML code, and not the website address.

       

      Please feel free to contact us for more information.

      Thanks.

      Dimitry - Wix Support
    • Reply from dlangpap | May 22, 2014

      Hi Dimitry,

       

      Thanks for your answer. It's noted that Wix can't do anything about external code.

      However, I believe that is not what I'm asking. What I'm asking is:

      1. If I update to premium would there still be a character limit when introducing code via the "add HTML code" option?

      2. How and where would I insert the " target="_blank" attribute" into this code so that any clicked link will open in a new page?

      Thanks

    • Reply from Alina | May 23, 2014

      Hey, 

      1. Please note that the character limit for the HTML code that you can add is 8,192 characters (for free and premium users - it is the same limit).

      2. Here you can find more information about the target attribute here

      You can easily add HTML code to your Wix site as follows:

      1. From the left toolbar, click "Add".
      2. From Add, click "Apps" > Click "HTML".
      3. Click the HTML box that appears in your editor > Click "Settings".
      4. Under Mode choose "HTML code" > Type or paste your HTML code into the "HTML/embed code" box.
      5. Click "Update".
      6. Choose whether or not the code should reset when a visitor leaves the page.
      7. Click outside the HTML settings window to close it.


      For more information on adding HTML code, please click here.


      Please let us know should you require any further assistance. 

      Alina, Wix Support Team
    • Reply from dlangpap | May 23, 2014

      Alina thanks for your reply. Finally I'm clear on the character limit for code (which is insufficient for my needs anyway).

      After having read the link you sent for adding the target attribute, I'm still not clear on where and how to insert it. As I can't embed my external shop via the add "HTML code" option because there are too many characters in the code, I have to use add "website address". Is it still possible to add the target attribute if I choose the  "add website address" option?

      Hope this makes sense.

      Cheers,

      DL

    • Reply from Alina | May 23, 2014

      Hey, 
       

      Unfortunately this isn't possible to open the embedded site in a new page at the moment. You can simply add a link from a button to the external URL. 

      To link a button to an external URL: Click the button to select it > from the pop-up menu, click Link To > click Web Address > under Insert a web address, enter the URL > choose whether the link should open in a new window or the same window > click OK.


      For more information please click here.


      Thanks, 

      Alina, Wix Support Team