[英]load file and write in xml or html?
I am curious if this is possible: 我很好奇这是否可能:
on the website: 在网站上:
Q1. Q1。 Is this achievable? 这可以实现吗?
Q2. Q2。 If so, what file is best used/supported? 如果是这样,最好使用/支持哪种文件? (php would be my very last alternative option) I prefer xml and html... (PHP将是我的最后一个替代选择)我更喜欢xml和html ...
Q3. Q3。 step 1 to 4 i can get to work - but step 5 i have totally no experience in. Anyone can guide me the right direction for writing those documents? 第1步到第4步我可以开始工作-但是第5步我完全没有经验。有人可以指导我正确的方向写那些文件吗?
You cannot write the file directly in the server using javascript. 您无法使用javascript直接在服务器中写入文件。
What you can do, for example, is send the updated data to a page in the server (sending a request to a PHP page, or a MVC endpoint, or whatever server-side technology you want to use) and then have the server code update the file using that data. 例如,您可以做的是将更新的数据发送到服务器中的页面(将请求发送到PHP页面,MVC端点或要使用的任何服务器端技术),然后获取服务器代码使用该数据更新文件。
You can do this with AJAX (eg. using jQuery with $.post ) if you want it to happen in the background, or with a normal request (which will reload the page or take the user elsewhere depending on the server code). 如果您希望它在后台发生,则可以使用AJAX来执行此操作(例如,将jQuery与$ .post一起使用),也可以使用常规请求(根据服务器代码将页面重新加载或将用户带到其他地方)进行处理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.