473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

JQuery Script Not Working:

2
So I'm a nube when it comes to JQuery and JavaScript as I mostly write PHP. My Jquery connection via google is working as I've tested it. However I'm not sure whats the problem is. The code is designed to count new messages and display the number of new messages. Code as follows:

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. $(document).ready(function() {
  3. var refreshId = setInterval(function(){
  4. $.ajax({
  5. type: "GET",
  6. url: "include/php/inboxcount.php",
  7. data: 'p=' +<? echo $username;?>.val(),
  8. success: function(count1){
  9. $('#showinboxcount').html(count1);
  10. }
  11. });
  12. });
  13. });
  14. </script>
  15.  
And the PHP code which is working fine is:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. include_once "conn/db.php";
  3. $p = stripslashes(trim(htmlspecialchars($_GET['p'])));
  4. $s = mysql_query("SELECT * FROM conversations WHERE (sender = '$p' AND starterstatus = 'unread') OR (recipient = '$p' AND recipientstatus = 'unread') ORDER BY date");
  5. $i = 0;
  6. while($row = mysql_fetch_array($s)) {
  7.     $i++;
  8. }
  9. echo $i;
  10. ?>
  11.  
Any help would be really appreciated.
Oct 8 '15 #1
0 1090

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: sivapriyan | last post by:
Hello, My java script function is working well in IE but not in Firefox My javascript is function visible() {...
4
by: itgaurav198 | last post by:
Hi, I have the following two problems. 1. The following script is Working in IE and not in Mozilla Firefox i.e. it si not setting the value of the textbox. <input type="text" name="notify">...
1
by: otiose3 | last post by:
I've been ploughing through the archives here, but I can't seem to find a solution for my situation... Essentially, I want to run the JQuery script that is in the "value" attribute of my <option>...
4
by: Hotice | last post by:
I have a form for registering some bookings. The problem is that I want to validate the data users enter in this form. All works fine, excepting the booking hours (ready by and closing time). This...
1
by: chetan7991 | last post by:
I'm using a jquery plugin Galleriffic in my page and it shows perfectly in all browsers except IE. The error says: "Object doesn't support this property or method" The code I use for script...
2
by: Jim Burgess | last post by:
I am trying to get a portion of javascript to work in Firefox that works perfectly in I.E. In this first section of code, I have a drop down box that when the value is changed to 29 (Other), it...
4
by: Alvaro Louzada | last post by:
i m using this script to expand a DIV function ShowDiv(Div-id) { if (false == jQuery(Div-id).is(':visible')) { jQuery(Div-id).show(250); } else { jQuery(Div-id).hide(250);
1
by: omar999 | last post by:
hi guys i really dont understand where i am going wrong.I've read countless articles including http://blog.nemikor.com/2009/10/03/using-multiple-versions-of-jquery/ but still having trouble with...
2
by: xiiopao | last post by:
hi there guys im currently working on a project with jquery... the thing is.. i need to change the contents of a div named "sub2" with the contents of "pets.html"... i've read some tutorials and i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.