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 7574241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:23:18+00:00 2026-05-30T16:23:18+00:00

i want to comment a code block, but i have a line in my

  • 0

i want to comment a code block, but i have a line in my javascript block which has jquery and php both

like this

jq('.time_slot').each(function(index) {
    var a = jq(this).autocomplete({ 
        serviceUrl:"<? echo $this->config->item('base_url'); ?>business/information/add/autocomplete",
        params: { suggessions_id:28767 }, //aditional parameters
        onSelect:function(value,data){ jq(this).trigger('change');  } 
    });
});

with out this line

      serviceUrl:"<? echo $this->config->item('base_url'); ?>business/information/add/autocomplete",

i can comment this block using

/*

*/

but now i can not use it , also i tried with single line comments , like this

//jq('.time_slot').each(function(index) {
    //var a = jq(this).autocomplete({ 
        //serviceUrl:"<? echo $this->config->item('base_url'); ?>business/information/add/autocomplete",
       // params: { suggessions_id:28767 }, //aditional parameters
       // onSelect:function(value,data){ jq(this).trigger('change');  } 
   // });
   // });

but for this line

 serviceUrl:"<? echo $this->config->item('base_url'); ?>business/information/add/autocomplete",

it is not working .

so i ended up with a very odinary solution like this

 //serviceUrl:"
<? //echo $this->config->item('base_url'); ?>
//business/information/add/autocomplete",

what is the best way to comment my code block , thank you in advance .

  • 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-30T16:23:20+00:00Added an answer on May 30, 2026 at 4:23 pm

    Ok, admittedly, this isn’t pretty, but if you want to cancel out the commingled PHP and JavaScript in one fell swoop, you might consider wrapping the entire block in a PHP condition that always returns false, e.g:

    <?php if (1 == 0) { ?>
    jq('.time_slot').each(function(index) {
        var a = jq(this).autocomplete({ 
            serviceUrl:"<? echo $this->config->item('base_url'); ?>business/information/add/autocomplete",
            params: { suggessions_id:28767 }, //aditional parameters
            onSelect:function(value,data){ jq(this).trigger('change');  } 
        });
    });
    <?php } ?>
    

    Ugly, I know, but undeniably quick and effective for big blocks of mixed code.

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

Sidebar

Related Questions

I'd like to have comments in my code, but I want them to be
I have some JavaScript, which is generated by PHP code, using a template. The
I want to match a block of code multiple times in a file but
When I want to comment code about control Enable/Disable and when I want to
I want to comment a line using the pre-processor: #define open /##* #define close
I have this string: comment_1234 I want to extract the 1234 from the string.
I want to create conditional comments in XSLT. But when I use this: <!--
I have a DIV where some code is presented. When I hover on this
I have a unsigned 64-bit word and a bit padded structure which are both
I have some c++ code with /* */ and // style comments. I want

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.