[英]How to redirect to another page when the button is clicked on React js?
[英]How to redirect to another page on the server when hyperlink is clicked?
我在用於托管網頁的服務器上的public_html文件夾中有一個名為index.php的主頁。 我在public_html內還有一個名為Assignment1的文件夾,該文件夾內是.html文件,.css文件和.js文件。
在我的主頁(index.php)上,我有一個錨標記,我想要做的是當用戶單擊錨時,它將頁面重定向到Assignment1文件夾中的.html文件,以便顯示我的整個作業1。
我遇到的麻煩是我不知道該怎么做。 我如何在Assignment1文件夾中引用該.html文件,並在單擊時將其重定向到它? 我試過將絕對路徑放在anchor標簽的href中,但這顯然行不通。
謝謝您的幫助。
<a href="Assignment1/assignment.html">Assignment1</a>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.