Home  >  Q&A  >  body text

javascript - dede 建站 如何在生成html 文件的时候 在head添加js

没使用过dedecms ,现在要二次开发一个网站,需要判断当用户使用手机进入的时候,
就使用js 跳转到指定的手机网站上呢?
我发现dede 都是可以自动生成html的,自己在每个html 上加好像不太合理,
谁可以讲解一下啊?
给我你的怀抱给我你的怀抱2682 days ago535

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-05-16 13:09:17

    There should be a template, you can add it in the head or foot.

    reply
    0
  • PHPz

    PHPz2017-05-16 13:09:17

    Just add it to the head of the template, or write a common js file and import it into the template.

    reply
    0
  • PHPz

    PHPz2017-05-16 13:09:17

    Functions that can be processed directly in the include/dedetag.class.php file without using js. I think you should change the LoadTemplate function and use $_SERVER['HTTP_USER_AGENT'] to determine the browser core. Of course, if you are not good at writing php, it will be awkward.

    reply
    0
  • Cancelreply