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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:44:26+00:00 2026-06-05T18:44:26+00:00

i want to read an html file by using jquery get function, replace some

  • 0

i want to read an html file by using jquery get function, replace some characters then display result. I wrote get function and can replace the text. There are many rows in the table. All data inside rows displayed as text. Rows are ended with space; so iwant to replace ” ;” characters for every row. But the code below just replace the characters for the first row. How can i replace all ” ;” characters for all rows?

$.ajax({
        url: 'http://url',
            type: 'GET',
            success: function(data) {
            var def = $(data).find('tbody#div.divWord').html();

                $('#def').append('<p><b>' + word + '</b>:' + def + '</p>');

                $("div").each(function() {
                    var text = $(this).text();
                    text = text.replace("  ;", "@");
                    $(this).text(text);
                });

            },
            error: function(data) {
                alert('error'); 
            }
        });
  • 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-05T18:44:29+00:00Added an answer on June 5, 2026 at 6:44 pm

    the Replace function only matches the first result by default.

    If you want to replace every occurence, you have to take a regular expression and set the “global flag”:

    text = text.replace(/ ;/g, "@");
    

    or

    text = text.replace(/\s;/g, "@");
    

    where \s matches Whitespace Characters.

    or

    text = text.replace(new RegExp(" ;","g"),"@");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to get some specific values in a (x)html file using an
I want to read the html file.And for that I use System.IO.File.ReadAllText(path) .It can
I want to read the file path from html input type=file (the entry selected
I want to read a single file (the file is a html document) from
I want to read mails from a mbox file and do some action based
I have code which uses the StreamReader to read HTML from a file, then
I want to read the contents of following file types using C#: RTF PDF
I would like to extract some text from an html file using Regex. I
Possible Duplicate: jquery - Read a text file? I want to read a local
I want to read the website text without html tags and headers. i just

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.