duanqinqian5299 2016-07-06 04:46
浏览 18

多个jquery路径导致页面减速

I have a responsive page created by jquery, php and ajax. The same page loads content from another php page based on the selected LI. I have this working fine. The php page includes other php pages depending on the LI selected. Do i need to include the CSS & jquery on all the php pages too? Including the script path in all the pages makes the response very slow.

Main Page:

<UL>
<li>1</li>
<li>2</li>
<li>3</li>
<UL>

PHP page where the LI selection is checked and includes the other php page:

if(isset($_POST['li'])){

    $li = $_POST['li'];

    if($li=='1'){
        include 'other1.php'
    }

    if($li=='2'){
        include 'other2.php'
    }

}

other1.php :

<div id="otherdiv1">

 click functions to do something . Functions included in jquery defined in MainPage. 

</div>


<div id="otherdiv2">



</div>

The other1.php is listed properly in the Main Page but does not do the onclick functions unless jquery is included in other1.php too.

Including the jquery path and jquery scripts path in every page is making the response very slow.

Is there any easy way around this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度