Umar Akram Posted October 10, 2013 Share 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> Link to comment Share on other sites More sharing options...
Valérie Assetskaya Posted October 10, 2013 Share Posted October 10, 2013 Hi, <?php echo "<script>alert('1234567890')</script>"; ?> Best regards. Link to comment Share on other sites More sharing options...
vekia Posted October 10, 2013 Share 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() Link to comment Share on other sites More sharing options...
Umar Akram Posted October 10, 2013 Author Share Posted October 10, 2013 thank you so much u Both are great I got it Stay Blessed. Link to comment 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