Shortcode – Javascript
-
Hi all,
i have this code in my post:<body onload="detectmob()"> <p><strong>scarica la musica</strong><p> <button onclick="detectmob()">Try it</button> <div id="textDiv">[sell_downloads columns=4] </div> </body>
detectmob function is:
function detectmob() { if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) ){ var div = document.getElementById("textDiv"); div.textContent = "[sell_downloads columns=1]"; return true; } else { var div = document.getElementById("textDiv"); div.textContent = "[sell_downloads columns=4]"; return false; } }
But this code print the TEXT “[sell_downloads columns=4]” and not change text in shortcode.
How i can add different shortcode in javascript code?
I need this because my responsive theme is so bad!
Thank you so much for help..
Valerio
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Shortcode – Javascript’ is closed to new replies.