Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5935783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:18:15+00:00 2026-05-22T15:18:15+00:00

Is there a way through some sort of meta or pre-processor to tell JavaScript

  • 0

Is there a way through some sort of meta or pre-processor to tell JavaScript that the word AND equates to && and the word OR equates to || and <> equates to !===?

Maybe equate THEN to {

END to }

NOT to !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:18:16+00:00Added an answer on May 22, 2026 at 3:18 pm

    No. Don’t do it.

    … well, there is a way, but don’t do it anyways…

    Here it is….

    function loadScriptWithReplacements(url) {
         try {
              var rq = null;
              if(window.XMLHttpRequest)
                   rq = new XMLHttpRequest();
              else if(window.ActiveXObject) {
                   try {
                        rq = new ActiveXObject("Msxml2.XMLHTTP");
                   } catch(o) {
                        rq = new ActiveXObject("Microsoft.XMLHTTP");
                   }
              }
              rq.open("GET", url, false);
              rq.send(null);
              document.write('<script>' + rq.responseText.replace(/(and|or|\<\>)/g, function(r) {
                   return {
                        'and': '&&',
                        'or' : '||',
                        '<>' : '!=='
                   }[r];
              }) + '</script>');
         } catch(ex) {
              // We can't have a fallback because you're using invalid JavaScript :(
              throw new Error("Could not use Ajax.");
         }
    }
    

    But, DO NOT DO THAT! You could also perform the replacements server-side, but DON’T DO THAT EITHER!

    Doing it server-side increases the strain on your server, doing something that could be avoided by just remembering how to write JavaScript correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any standard way of implementing some sort of a write-through buffer for
Through reflection, is there some way for me to look at a generic List's
Is there a way to assign some sort of delegate object when [[NSData alloc]
Is there a way in java to declare a method argument, that is some
Is there a way through the .net framework to determine if a folder is
Is there a way to fall through multiple case statements without stating case value:
Is there a way to iterate (through foreach preferably) over a collection using reflection?
Is there a way to step through a .bat script? The thing is, I
Is there a way of iterating through an array but performing an operation on
Is there a way to look through the cache for all objects in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.