我想知道如何用PHP代码替换链接文本。我有这样的代码:用PHP代码替换文本
<div class='rmm' data-menu-title = "Navigation" data-menu-style = "custom"> <!-- data-menu-title = Input your Menu text (This is the text to the right of the mobilestate menu)-->
<ul><li id="current_yes"><a href="#">HEM</a></li></ul>
</div>
,我希望它看起来魔神此:
<div class='rmm' data-menu-title = "Navigation" data-menu-style = "custom"> <!-- data-menu-title = Input your Menu text (This is the text to the right of the mobilestate menu)-->
<ul><li id="current_yes"><a href="#"><?php echo $lang['MENU_HOME']; ?></a></li></ul>
因此,如何在页面加载jQuery的改变呢?
谢谢。
你想使用jQuery去改变它或你想用PHP来做到这一点?关于PHP的标题问题,但在你的问题内部问是用jQuery来做这件事......我很困惑。 – OscarGarcia
这是完全令人困惑的,我认为Patrik希望PHP代码在与JS一起放入HTML时执行,但这不是它的工作方式:1.用户请求从浏览器到服务器的响应。 2.服务器使用PHP创建HTML + JS输出。 3. HTML + JS发送到浏览器。 4. HTML被渲染,JS在浏览器中被执行。 5.转到1并重复。 – mondjunge