Anyx Posted July 25, 2018 Share Posted July 25, 2018 I am actually new on coding and searched but found nothing about this. Let's say I have a JavaScript file to be executed in my HTML/PHP file. How can I disable its execution using code (even with JavaScript itself) without removing it from the code? I know it is useless for most cases; I just want to know if I can do that. Quote Link to comment Share on other sites More sharing options...
mike Posted August 21, 2018 Share Posted August 21, 2018 On 25/07/2018 at 5:53 PM, PCTipsGR said: I am actually new on coding and searched but found nothing about this. Let's say I have a JavaScript file to be executed in my HTML/PHP file. How can I disable its execution using code (even with JavaScript itself) without removing it from the code? I know it is useless for most cases; I just want to know if I can do that. Please explain further in what situation you would need this. I might have an idea, but it depends on the situation. Quote Link to comment Share on other sites More sharing options...
PlanetCloud Posted August 22, 2018 Share Posted August 22, 2018 On 7/25/2018 at 10:53 PM, PCTipsGR said: I am actually new on coding and searched but found nothing about this. Let's say I have a JavaScript file to be executed in my HTML/PHP file. How can I disable its execution using code (even with JavaScript itself) without removing it from the code? I know it is useless for most cases; I just want to know if I can do that. I missed this topic and to do this just add a logic such as : var execute_code = true; if(execute_code){ // Code to be executed // Change true to false skip code execution } Quote Link to comment Share on other sites More sharing options...
1442810249 Posted September 13, 2018 Share Posted September 13, 2018 On 2018/8/22 at 1:39 PM, PlanetCloud said: I missed this topic and to do this just add a logic such as : var execute_code = true; if(execute_code){ // Code to be executed // Change true to false skip code execution } Which file does this code insert? Insert my website source code? Quote Link to comment Share on other sites More sharing options...
1442810249 Posted September 13, 2018 Share Posted September 13, 2018 Just now, 1442810249 said: Which file does this code insert? Insert my website source code? Here is the source code of my website program. Quote Link to comment Share on other sites More sharing options...
1442810249 Posted September 13, 2018 Share Posted September 13, 2018 On 2018/8/22 at 1:39 PM, PlanetCloud said: I missed this topic and to do this just add a logic such as : var execute_code = true; if(execute_code){ // Code to be executed // Change true to false skip code execution } Is it convenient to use e-mail to chat? my email :[email protected] thanks Quote Link to comment Share on other sites More sharing options...
1442810249 Posted September 13, 2018 Share Posted September 13, 2018 On 2018/7/25 at 11:53 PM, PCTipsGR said: I am actually new on coding and searched but found nothing about this. Let's say I have a JavaScript file to be executed in my HTML/PHP file. How can I disable its execution using code (even with JavaScript itself) without removing it from the code? I know it is useless for most cases; I just want to know if I can do that. Is it convenient to use e-mail to chat? Quote Link to comment Share on other sites More sharing options...
1442810249 Posted September 13, 2018 Share Posted September 13, 2018 On 2018/8/22 at 4:08 AM, mike said: Please explain further in what situation you would need this. I might have an idea, but it depends on the situation. Is it convenient to use e-mail to chat? Quote Link to comment Share on other sites More sharing options...
Anyx Posted September 13, 2018 Author Share Posted September 13, 2018 2 minutes ago, 1442810249 said: Is it convenient to use e-mail to chat? Well yes, you can use your email to chat, but why did you hijack my topic to ask that? Quote Link to comment Share on other sites More sharing options...
1442810249 Posted September 13, 2018 Share Posted September 13, 2018 Just now, PCTipsGR said: Well yes, you can use your email to chat, but why did you hijack my topic to ask that? [email protected] I think you are warmer.Even if you can't help me. thanks Quote Link to comment Share on other sites More sharing options...
1442810249 Posted September 13, 2018 Share Posted September 13, 2018 30 minutes ago, PCTipsGR said: Well yes, you can use your email to chat, but why did you hijack my topic to ask that? 35 minutes ago, PCTipsGR said: Well yes, you can use your email to chat, but why did you hijack my topic to ask that? hello? Quote Link to comment Share on other sites More sharing options...
Anyx Posted September 13, 2018 Author Share Posted September 13, 2018 Just now, 1442810249 said: hello? well, I sent you an email, but still no response. What are you trying to do here exactly? Quote Link to comment Share on other sites More sharing options...
PlanetCloud Posted September 14, 2018 Share Posted September 14, 2018 @1442810249, The code is very versatile and can be inserted into any JavaScript (.js) file... Quote Link to comment Share on other sites More sharing options...
Mauwiks Posted September 18, 2018 Share Posted September 18, 2018 On 9/13/2018 at 10:07 PM, PCTipsGR said: Well yes, you can use your email to chat, but why did you hijack my topic to ask that? LOL. Quote Link to comment Share on other sites More sharing options...
Mauwiks Posted September 18, 2018 Share Posted September 18, 2018 On 9/15/2018 at 7:07 AM, PlanetCloud said: @1442810249, The code is very versatile and can be inserted into any JavaScript (.js) file... What exactly happens after this? Will your clients unable to use or execute JS on the server or your hosting anymore? @PCTipsGR Quote Link to comment Share on other sites More sharing options...
Anyx Posted September 18, 2018 Author Share Posted September 18, 2018 16 minutes ago, Mauwiks said: What exactly happens after this? Will your clients unable to use or execute JS on the server or your hosting anymore? @PCTipsGR No, of course not! It will just prevent the load of one JS file if certain conditions are not met. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.