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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:59:28+00:00 2026-06-10T20:59:28+00:00

I have this code <script type=text/javascript> $(function () { var selectedAmenities = ; function

  • 0

I have this code

<script type="text/javascript">
    $(function () {

        var selectedAmenities = "";

        function amenitiesLog(message) {
            $("<div/>").text(message).appendTo("#amenitiesLog");
            $("<br/>").text("").appendTo("#amenitiesLog");
            $("#amenitiesLog").scrollTop(0);

            selectedAmenities = document.getElementById("amenitiesLog").innerHTML;
        }

        $("#Amenities").autocomplete({
            //source: "/Results/GetAmenities",
            source: function (request, callback) {
                var url = "/Results/GetAmenities?selected=" + selectedAmenities + '&term=' + request.term;
                $.getJSON(url, callback);
            },
            minLength: 3,
            select: function (event, ui) {
                if (ui.item != null)
                    amenitiesLog(ui.item.value);
            }
        });
    });
</script>​​​​​

Which causes this url to be generated and called

http://localhost:63320/Results/GetAmenities?selected=%3Cdiv%3EAir%20conditioning%3C/div%3E%3Cbr%3E&term=abc

The error I get in Firebug is this

A potentially dangerous Request.QueryString value was detected from the client (selected=&quot;&lt;div&gt;Air conditionin...&quot;).

What is the solution?

Thanks,

Sachin

  • 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-06-10T20:59:29+00:00Added an answer on June 10, 2026 at 8:59 pm

    I had something similar to this once and I had to declare what my invalid URL characters were. I did this in my web config as:

    <system.web>
        <httpRuntime requestValidationMode="2.0" executionTimeout="600" requestPathInvalidCharacters="&lt;,&gt;,*,%,\" relaxedUrlToFileSystemMapping="true" />
    </system.web>
    

    Where ‘requestPathInvalidCharacters’ contained the invalid characters, so in my case, I removed the colon as I needed this in my URL.

    This worked for me but as to whether there are some security risks here that you need to think about, I don’t know.

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

Sidebar

Related Questions

I have this code: <script type=text/javascript> var maxLength=10; function charLimit(el) { if (el.value.length >
I have this code: <script type=text/javascript> var loader = #loader; $(function() { $(#selUsers).change(function() {
I have this code: <script type=text/javascript> function showTotal(form, totalEl) { var el, els =
I have this code: <script type=text/javascript> $(document).ready(function() { var url = https://graph.facebook.com/search?q=cinema&type=post; $.ajax({ type:
i have this code: <script type=text/javascript> $(document).ready(function() { function doAjax(url) { $(#customForm).submit(function() { var
I have this jQuery code: <script type=text/javascript > $(function() { $('#add_comment').bind('submit',function() //$(input[type=submit]).click(function() { var
I have this code: <script type=text/javascript> function js() { var getJs = document.getElementById(jogo); if
I have this code running great in ff, opera and chrome: <script type=text/javascript> $(document).ready(function(){
i have code like this: <script type=text/javascript> var _gaq = _gaq || []; _gaq.push(['_setAccount',
I have this code <title>Welcome</title> <head> <script type=text/javascript> var id = ...; var sessionCount

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.