簡體   English   中英

在 php 代碼中集成 history.back(-1)

[英]integrating history.back(-1) in php code

我不是 php 開發人員,而且我對 html 有基本的了解。

我目前有這個代碼

 <div class="page-header"> <h1 class="<?php echo $this->item->backlink ? "backlink" : ""; ?>"> <?php echo $this->item->backlink ? '<a class="backtomap" href="' . $this->item->backlink . '">' . JText::_('COM_FOCALPOINT_BACK_TO_MAP') . '</a>' : ""; echo trim($this->item->title); ?> </h1> </div>

現在我想集成 history.back 函數來代替當前

onclick="history.back(-1)"

以便生成的 html 看起來像

 <a class="backtomap" href="#" onclick="history.back(-1)>' . JText::_('COM_FOCALPOINT_BACK_TO_MAP') . '</a>'

我試圖在這里和那里更改代碼,但如果沒有正確的知識,它就無法真正起作用。

有人可以幫忙嗎?

謝謝你。

換線就好

'<a class="backtomap" href="' . $this->item->backlink . '">' . JText::_('COM_FOCALPOINT_BACK_TO_MAP') . '</a>' 

'<a class="backtomap" href="#" onclick="history.back(-1)" >' . JText::_('COM_FOCALPOINT_BACK_TO_MAP') . '</a>'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM