Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to alert if there's some changes in values/data?

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #179728
    web_editor
    Participant

    How to alert the user if there’s a some changes in data/values? Example is the home address. And if detected there’s some changes, it will call or popup the html file where the changes are save. I have two codes, one for scanning the values. And second, open a new tab for Google Map. I want to do this in pure/native JavaScript. I’m not really a programmer, please help me. Thanks

    Note: I don’t have privilege to edit/customize the entire html

    Here’s the code of getting some values/informations

    And here’s the second code

    #179743
    Paulie_D
    Member

    I’m not really a programmer, please help me.

    It’s not clear what you are trying to do but you really shouldn’t be tinkering with something you don’t understand.

    We can’t really comment with any great degree of confidence as it’s unlikely we’ll have enough information to ensure that what we might suggest won’t break something else on your site.

    For this sort of thing…you should really think about hiring someone.

    #179773
    web_editor
    Participant

    I mean I’m not a totally a programmer. I’m just a beginner in this field. This question is related to this one . Let’s say contact address (which is already mention in my code) did some changes, the user will get an alert box that saying “There’s a new address blah blah blah”

    #179775
    Paulie_D
    Member

    As I said…

    We can’t really comment with any great degree of confidence as it’s unlikely we’ll have enough information to ensure that what we might suggest won’t break something else on your site.

    For this sort of thing…you should really think about hiring someone.

    #179803
    Paulie_D
    Member

    Sounds like it needs a function to compare strings and if different show an alert asking if the user wants to confirm.

    Is so, proceed with the ‘save’, presumably carry out some form of validation and go from there.

    There’s some pretty extensive JS in the other threadhttps://css-tricks.com/forums/topic/how-to-get-and-display-the-values-in-html-page/#post-179771

    Not sure where it came from (or who wrote) it but there it is.

    Perhaps it could be adapted…..

    #179954
    web_editor
    Participant

    Some changes in the values made by other user. There’s a three pages, first page (html page) where the changes made, second (html page) where the changes save/store and the third page contain the original values and it will alert if there’s some changes/update from the third page (wherein the changed values store). Here’s my JS to scan and get the values and display to the search box of google maps itself

    #180202
    web_editor
    Participant

    But I don’t have database or server. i just store the data into fileserver. Hmm. But now I change my plan.. Now, how can I display a values from UAT to html page created?

    #180204
    nixnerd
    Participant

    All this does not sound like the right approach. I gotta agree with @nkrisc. How hard is it to install SQLite?

    #180205
    __
    Participant

    I don’t have privilege to edit/customize the entire html

    JS to scan and get the values and display

    how can I display a values from UAT to html page created?

    You mention “UAT” in several of your threads. What does this refer to? are you talking about uat.edu? are you trying to scrape information from this site? if so, do you have permission from UAT to do this?

    Unauthorized copying, downloading, uploading, sharing, installing, or distributing of copyrighted material for which UAT or the end user does not have express permission to use or does not fall within Fair Use guidelines is strictly prohibited.
    http://www.uat.edu/about_uat/copyright_notice.aspx

    If this is what you’re trying to do, note that it is almost always easier to get permission, because the information you want is usually available in a more convenient format. There might be APIs in place that allow you to access the data you need directly, instead of trying to parse it from the HTML (which is notoriously difficult, with lots of “edge” cases to account for, and is ultimately unreliable).

    #180207
    nixnerd
    Participant

    I had no idea what UAT was either… assumed it was something that wasn’t totally relevant to the question. I also assumed OP had full control over the site he/she was trying to monitor changes to. Had no idea this was about scraping.

    Assuming that you are talking about the school… and assuming they don’t have an API… and assuming you get permission to scrape their content… and assuming you can properly parse what you scrape… you can write a cron scrip to wget or curl the content every hour or so, then write a script to compare the md5 checksum.

    This is such a bad option though. There is surely another way to get the info you want.

    It’s worth noting that this is EXACTLY the same thing that ruined Aaron Swartz’s life… scraping content from an institution of higher education. Now he’s dead.

    https://www.youtube.com/watch?v=RvsxnOg0bJY

    #180209
    __
    Participant

    To be clear, I am not sure what is “going on” —not even sure we’re really talking about scraping— which is why I ask. I’d like to be sure that the OP is aware of any potential complications/liabilities, but I am not making any accusations.

    NIX is right, though. Even if everything is totally “above board,” scraping is almost certainly the worst possible solution.

    #180214
    nixnerd
    Participant

    Yeah sorry to sound accusatory as well. Didn’t mean to. We’re all just confused.

    I like to add potentially relevant info for posterity. We’re curating the web here folks and this is the pantheon :)

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.