pascal Posted November 10, 2023 Report Share Posted November 10, 2023 Hi, I have a table with all my IP adress of all my connected things. I made a webpage, showing my table with all the IP adresses when clicking on a field in the table, I put the IPadress (ASCII) into a tag -> IP adres (reading the selected row of the datatable) on the webpage a put a hyperlink "GO TO" with the adress of this hyperlink the value of tag IP adress but when clicking on the hyperlink, he's calling another IP adress..... I did an inspect of the webpage (clicking right mouse button 😁) and found something strange.... BUT I FOUND a solution ? -> the problem is the leading zero's of the IP adres in my tag.... when I remove the leading zero's, then I have a correct hyperlink (only tried one (172.20.25.40) something to keep in mind... Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted November 10, 2023 MVP 2023 Report Share Posted November 10, 2023 I don't know if it's related, but I was having a similar problem when Pinging an IP address from Windows. I've discovered that in Ping, when using a leading zero it interprets the number as hex rather than decimal. Seems silly to me, but true nevertheless. Link to comment Share on other sites More sharing options...
Saragani Posted November 12, 2023 Report Share Posted November 12, 2023 This is actually, not the Web Server or the PLC's fault. Here is just a simple example of a single hyperlink that reproduces the problem (No Web server or JavaScript are involved, just plain HTML). You can see that it navigates to 172.20.25.33 instead of 172.20.25.41 41 in Oct base (8 base, digits 0-7) is exactly 33, and if you put .010 instead of 041, it will go to 8 (since 10 in oct base is 8). I'm guessing that when padding a zero before the number, chrome (and probably all the browsers) is parsing it in Oct base. You can read about it here as well: https://superuser.com/questions/857603/are-ip-addresses-with-and-without-leading-zeroes-the-same test.html 1 Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted November 13, 2023 MVP 2023 Report Share Posted November 13, 2023 On 11/10/2023 at 9:27 AM, Flex727 said: in Ping, when using a leading zero it interprets the number as hex rather than decimal On 11/12/2023 at 2:59 AM, Saragani said: when padding a zero before the number, chrome (and probably all the browsers) is parsing it in Oct base Ah! Octal, not hex. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now