Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery页面加载行为_Jquery_Jquery Ui - Fatal编程技术网

jquery页面加载行为

jquery页面加载行为,jquery,jquery-ui,Jquery,Jquery Ui,我的项目有3页 jq-scripts.js // # DOM Ready $( function() { $('.ttip').tooltip(); $( '#sample_page' ).load("sample.php"); }); sample.php <p class="ttip" title="some text">Hallo</p> 您好 index.php <head> <link rel="stylesheet"

我的项目有3页

jq-scripts.js

// # DOM Ready
$( function() {

  $('.ttip').tooltip();

  $( '#sample_page' ).load("sample.php");

});
sample.php

  <p class="ttip" title="some text">Hallo</p>

您好

index.php

<head>

<link rel="stylesheet" href="css/smoothness/jquery-ui-1.10.0.custom.css" type="text/css" />

<script type='text/javascript' src='js/jquery-1.9.1.js'></script>

<script type="text/javascript" src="js/jquery-ui-1.10.0.custom.min.js"></script>

<script type='text/javascript' src='js/jq-scripts.js'></script>

</head>

<body>

<div id="sample_page"></div> <!-- TOOLTIP DON'T WORK -->

<p class="ttip" title="some text">Hallo</p> <!-- TOOLTIP WORK -->

您好

有人知道为什么加载页面(sample.php)的工具提示不起作用吗?

谢谢

一旦元素实际可用,您可能应该初始化工具提示插件:

$( function() {
    $( '#sample_page' ).load("sample.php", function() {
        $('.ttip').tooltip();
    });
});

一旦元素实际可用,您可能应该初始化工具提示插件:

$( function() {
    $( '#sample_page' ).load("sample.php", function() {
        $('.ttip').tooltip();
    });
});
这应该行得通

$( function() {
  $( '#sample_page' ).load("sample.php");
$('.ttip').tooltip();

});

因为我无法在.load()中加载sample.php页面,所以请使用innerhtml,

这应该可以工作

$( function() {
  $( '#sample_page' ).load("sample.php");
$('.ttip').tooltip();

});

由于我无法在.load()中加载sample.php页面,所以请创建innerhtml,