Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery not responding when moved from HTML to PHP?
    primarykey
    data
    text
    <p>The Venkman debugger says this:</p> <pre><code> $("#aboutbox") is null [Break On This Error] $("#aboutbox").hide(); </code></pre> <p>But I don't know what to do to fix it! It worked perfectly in HTML: <a href="http://leventhan.webfactional.com/static/" rel="nofollow">http://leventhan.webfactional.com/static/</a> But when I moved it to PHP, it just stopped working.</p> <p>Here's the index.php:</p> <pre><code> &lt;?php require_once dirname(__FILE__)."/src/phpfreechat.class.php"; $params = array(); $params["title"] = "Quick chat"; $params["nick"] = "guest".rand(1,1000); // setup the intitial nickname $params['firstisadmin'] = true; //$params["isadmin"] = true; // makes everybody admin: do not use it on production servers ;) $params["serverid"] = md5(__FILE__); // calculate a unique id for this chat $params["debug"] = false; $chat = new phpFreeChat( $params ); ?&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt; &lt;title&gt;phpFreeChat- Sources Index&lt;/title&gt; &lt;link rel="stylesheet" title="classic" type="text/css" href="style/styles.css" /&gt; &lt;link rel="stylesheet" title="classic" type="text/css" href="style/content.css" /&gt; &lt;script type="text/javascript"src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery-1.4.4.min.js"&gt;&lt;/script&gt; &lt;SCRIPT type="text/javascript" src="oracle.js"&gt;&lt;/SCRIPT&gt; &lt;script type="text/javascript"&gt; // some google maps javascript code that works fine &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;header&gt; &lt;div id="aboutbox"&gt; &lt;br&gt; &lt;p&gt;&lt;strong&gt;GeoChat is the perfect chat app to hatch your world domination plans. A place on the web where you can point to maps and chat at the same time. A great way for teachers to teach and students to learn with an interactive map. &lt;/strong&gt;&lt;/p&gt; &lt;/div&gt; &lt;div id ="nav"&gt; &lt;h1&gt;GeoChat&lt;/h1&gt;&lt;h2&gt;&lt;a href="#" id="changebg"&gt;Toggle background&lt;/a&gt;&lt;a href="#" id="toggle"&gt;Chat Help&lt;/a&gt;&lt;a href="#" id="about"&gt;What's all this about?&lt;/a&gt;&lt;/h2&gt; &lt;/div&gt; &lt;/header&gt; &lt;div id="map_canvas"&gt;&lt;/div&gt; &lt;div class="content"&gt; &lt;?php $chat-&gt;printChat(); ?&gt; &lt;?php if (isset($params["isadmin"]) &amp;&amp; $params["isadmin"]) { ?&gt; &lt;?php } ?&gt; &lt;/div&gt; &lt;footer&gt; &lt;p&gt;&amp;#10084 Made by &lt;strong&gt;&lt;a href="http://cloudborn.me" id="name"&gt;Author&lt;/a&gt;&lt;/strong&gt; with love.&lt;a href="javascript:#" id="dirbutton"&gt;Go up &amp;#8593&lt;/a&gt;&lt;/p&gt; &lt;/footer&gt; &lt;/body&gt;&lt;/html&gt; </code></pre> <p>Here's the live broken site: <a href="http://leventhan.webfactional.com/phpfreechat-1.3/" rel="nofollow">http://leventhan.webfactional.com/phpfreechat-1.3/</a></p> <hr> <p>EDIT: Yeah, jQuery worked again when I commented out the chat app (phpFreeChat), this part: </p> <pre><code>&lt;div class="content"&gt; &lt;?php $chat-&gt;printChat(); ?&gt; &lt;?php if (isset($params["isadmin"]) &amp;&amp; $params["isadmin"]) { ?&gt; &lt;?php } ?&gt; &lt;/div&gt; </code></pre> <p>And it turns out the problem is really because jQuery is conflicting with Prototype.js (phpFreeChat uses Prototype apparently.) The solution is to use:</p> <pre><code>jQuery.noConflict(); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload