Umar Akram Posted October 10, 2013 Posted October 10, 2013 i want to call a php function inside a javascript.how is that possible...??In category tpl i used javascript.where i want to redirect the page in javasacript. in javascript code i want to give the modules path. and this is possible only in case of php tags. so how is that possible..??my java script function is that. # sign is that from where i want to redirect the page. <script>function fitness(){var val=document.getElementById('level').value;if(val==0){ alert('Please select the current fitness level');}else{ location.href = ("#");}}</script> Share this post Link to post Share on other sites More sharing options...
Valérie Assetskaya Posted October 10, 2013 Posted October 10, 2013 Hi, <?php echo "<script>alert('1234567890')</script>"; ?> Best regards. Share this post Link to post Share on other sites More sharing options...
vekia Posted October 10, 2013 Posted October 10, 2013 i want to call a php function inside a javascript. you can't run php script inside javascript code. you can only run php code with ajax query (from js script create ajax call $.post() Share this post Link to post Share on other sites More sharing options...
Umar Akram Posted October 10, 2013 Posted October 10, 2013 thank you so much u Both are great I got it Stay Blessed. Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now