0

How can i add a relative link in code playground

if I want to set a relative link in playground..if I want to do <a href = "">Contact</a>.. how can I do that?

10th Feb 2017, 9:31 AM
Surya Poojary
Surya Poojary - avatar
3 Respostas
+ 4
You cannot :( Unfortunally, Code Playground is limited on some points... This is one. Because relative links means relative to the emplacement of the source code file, and you have only virtuals files with this sytem. And anyway, absolute links are not well working ( at least as expected ) in it too, as you cannot link another playground page, and any external links will be blocked to avoid load in place of the code playground web app page ( in this case, providing a 'target="_blank" let load the link in a new tab/window ), when in android app the clicked link is send to web browser ^^ Another cheat, is to simulate links and page load behaviours dynamically with JS... but this is a big work way for few interest: outside code playground you will not encounter often this kind of context. Better is to considerate that code playground is not for big/real projects, but just for snippet / testing purposes ;)
10th Feb 2017, 10:04 AM
visph
visph - avatar
+ 1
Not necessarly: in integrated preview of AnWritter ( an html/css/js IDE app for android ), absolute link are loaded without be send to browser... but in this case, relative links are also working, as you save a real file on a real folder of your device, so you know relative to what ^^ And maybe you can use ( in code playground as other apps ) absolute local links ( prefixed by 'file' instead of 'http' )... but always in code playground, you cannot use such path for <a> elements, only for linked ressources, as images, sounds... We should try if this work for linked css and/or js file, even if for share purpose, it would be a non-sense as others people cannot have access to yours local files :P
10th Feb 2017, 10:26 AM
visph
visph - avatar
0
Any Android app that can act like a web ide???
10th Feb 2017, 10:14 AM
Surya Poojary
Surya Poojary - avatar