How to change the IP in the code below to automatic? Automatically adapt directly based on the actual web page address visited.
title);return false;">test.264
8554/02.mp3" href="#" onclick="doGo(this.title);return false;">02.mp3
;
How to execute do.Go(rtsp://192.168.12.44:8854/test.264) immediately when the web page first comes in;
Reply to discussion (solution)
How to change the IP in the code below to automatic?
What does this do?
Just write the relative path directly.
The second question is as follows
<!DOCTYPE HTML><html> <head> <meta charset="gb2312" /> <title></title> <style> </style> </head> <body> <div style="margin: 50px"> <a title="test.264" href="#" onclick="doGo(this.title);return false;" id="test">test.264</a> <span style="margin: 20px;" /> <a title="02.mp3" href="#" onclick="doGo(this.title);return false;">02.mp3</a> <span style="margin: 20px;" /> </div> <script> function $(el){ return typeof el == 'string' ? document.getElementById(el) : el; } function doGo(o){ alert(o) }; $('test').onclick(); </script> </body></html>The problem is that it is not a relative path problem
rtsp://192.168.12.44: 8554/test.264
This is a playback stream of RTSP protocol, not a web page.
Both the WEB server and RTSP server are on the same machine
There is no problem when the server IP is 192.168.12.44
What happens when it is changed to 192.168.12.43?
You can’t change the IP once. The content on the web page must be modified accordingly, right?
<!DOCTYPE HTML><html> <head> <meta charset="gb2312" /> <title></title> <style> </style> </head> <body> <div style="margin: 50px"> <a title="test.264" href="#" onclick="doGo(this.title);return false;" id="test">test.264</a> <span style="margin: 20px;" /> <a title="02.mp3" href="#" onclick="doGo(this.title);return false;">02.mp3</a> <span style="margin: 20px;" /> </div> <script> function $t(name, cot){ cot = cot || document; return cot.getElementsByTagName(name); } function doGo(o){ alert(o) }; //$('test').onclick(); var ip = 'rtsp://192.168.12.43:8554/'; var obj = $t('a'); for(var i = 0, len = obj.length; i < len; i++){ obj[i].title = ip + obj[i].title; } </script> </body></html>
What does this mean?
The host can save this js as a separate js file and call it on every page. If the IP is changed, every page will be changed.
I make a network camera
The WEB server is in the network camera.
The web page will be fixed after being burned inside.
Therefore, what I need is not to manually modify the web page or the content in JS
When I use http://192.168.a.b/index.html to access it
I use rtsp://192.168.a.b /live.264 visit
In this case, how should I modify it?
HTML code
" />
t;
< ;div style="margin: ...
var ip = 'rtsp://' location.host '/';
var ip = 'rtsp://' location.host ' /';
That’s what it means

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools