You can inject any PHP value into clientside.
<script>
var baseURL = <?php echo json_encode($baseURL); ?>;
</script>
Use json_encode
because this gives foolproof safe way of delivering data in the format JS understands, and works on real arrays, PHP "arrays", numbers, strings, whatever you want.
try this:
<script>
window.yourGlobalVariable = ....
</script>
by using you window it will be available for all your site
see: Define global variable in a JavaScript function
I tried this $("#add").click(function(){ var $newIems = $("<div class='post-body post item'>itemName</div>") $(".items").isotope("append", $newIems, true); }); $("#sort").click(...
I tried this $("#add").click(function(){ var $newIems = $("<div class='post-body post item'>itemName</div>") $(".items").isotope("append", $newIems, true); }); $("#sort").click(...
I got a a dropdown list populating from a php while loop. There will be more than one select dropdown boxes. When i select any dropdown from the loop, the subsequent textbox should change the value. ...
I got a a dropdown list populating from a php while loop. There will be more than one select dropdown boxes. When i select any dropdown from the loop, the subsequent textbox should change the value. ...
I have a page with 2 iframe tags: <iframe src="top.html" seamless="seamless" width=100% height=100% id="up" name="up" frameborder="0"></iframe> <iframe src="main.html" seamless="...
I have a page with 2 iframe tags: <iframe src="top.html" seamless="seamless" width=100% height=100% id="up" name="up" frameborder="0"></iframe> <iframe src="main.html" seamless="...
I have the following lines of code in my webpage - example/demo. HTML: <p data-toggle="modal" data-target="#messagesModal"><a href="#">Messages <span class="badge">2</span>&...
I have the following lines of code in my webpage - example/demo. HTML: <p data-toggle="modal" data-target="#messagesModal"><a href="#">Messages <span class="badge">2</span>&...