简体   繁体   中英

Open links in new Window/Tab

I cant seem to figure out how to get the links to open in a new window or tab. Feeling like a total newbie. Any thoughts? Live link: http://wp11004271.server-he.de/alloytoy5.5.1/

        function RenderItem(number, item) {
            if (typeof item != "undefined")
                return "<div class='bit-5'>\n\
                            <a href='" + item.link + "' id='alloy_" + number + "'>\n\
                                 <p class='alloy' >\n\
                                    " + item.name + "\n\
                                </p>\n\
                            </a>\n\
                        </div>";

            else
                return "";
        }

You just need a target attribute; _blank in this case.

<a href='" + item.link + "' target='_blank' id='alloy_" + number + "'>\\n\\

You can find the supported values of this attribute here: http://www.w3schools.com/tags/att_a_target.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM