anujgarg Posted October 10, 2009 Share Posted October 10, 2009 Hi I want to write following code in PHP: echo " <script language=javascript> alert("hi") </script>"; I need to display same code on webpage while blocking the alert message to be appeared on there. How can I do it?? Please suggest... TIA Anuj Link to comment https://forums.phpfreaks.com/topic/177213-block-javascript-in-php/ Share on other sites More sharing options...
.josh Posted October 10, 2009 Share Posted October 10, 2009 I have no idea what you mean but I know one thing wrong with what you posted is you use double quotes nested inside double quotes without escaping them. You need to escape the double quotes surrounding "hi" like this: \"hi\" or else use single quotes 'hi' Link to comment https://forums.phpfreaks.com/topic/177213-block-javascript-in-php/#findComment-934411 Share on other sites More sharing options...
anujgarg Posted October 10, 2009 Author Share Posted October 10, 2009 Crayon, I wanted to know that how can I skip the default functionality of javascript. More specifically, can we avoid to execute the alert message while running the file in the browser? Please let me know if you need more specification. TIA Link to comment https://forums.phpfreaks.com/topic/177213-block-javascript-in-php/#findComment-934414 Share on other sites More sharing options...
.josh Posted October 10, 2009 Share Posted October 10, 2009 you can avoid executing it by removing it? You're going to have to provide more details about your situation... Link to comment https://forums.phpfreaks.com/topic/177213-block-javascript-in-php/#findComment-934416 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.