Execute .php Periodically Without Page Refresh?

Feb 16, 2010

First off; i was in two minds if this belonged in the .php forum or the javascript forum; i apologize if i chose the wrong one.

I have this .php code:
<?php
$query = "SELECT mail_id FROM ".TBL_MAIL." WHERE UserTo = '$session->username' and status = 'unread'";
$numUnreadMail = $database->query($query) or die(mysql_error());

[Code]....

I wondered how or if it is even possible to use javascript to execute the first .php code so that the user would know if he/she had a new message without refreshing the page?

View 15 Replies


ADVERTISEMENT

Doesn't Execute Page Refresh In IE8?

Apr 8, 2010

FF, Safari, Opera all execute this javascript code to refresh the page properly, but in IE version 8.0.6001.18904 the page doesn't seem to refresh on click of orange_refresh button. I have checked out a different version of IE8, don't recall exact version, but it did seem to work fine in that one, whatever version it was probably the latest now that I think of it. Check out code below any sug.'s could be helpful, though its probably a bug..

<a href="javascript:document.location.reload();"
onmouseover="window.status='Refresh'; return true"
onmouseout="window.status='Page Refreshed'"><img src="image/orange_refresh.png"
width="30" height="30" border="0" /></a>

View 5 Replies View Related

Function On HTML Page That Periodically Assigns Content To A DIV?

Jul 16, 2010

I have a javascript function on my HTML page that periodically assigns content to a DIV. This I am doing with a timer (setTimeout).If under certain circumstances, display of the DIV is set to 'none' or the visibility is set to 'hidden', how does Javascript handle it?

View 3 Replies View Related

JQuery :: .ajax And Page Refresh In Firefox - Can't Send Form Data In FF Without Page Refresh

Apr 15, 2010

So my problem is that i can't send form data in FF without page refresh (though in IE7-8 everything works smoothly).

My code fragments:

View 1 Replies View Related

Ajax :: Call Struts Action Periodically?

Jan 5, 2011

I am doing a very simple POC regarding Instant Messaging using Struts. So I was able to do login and sending message. However, I am confused on how I can get the messages display to my POC if the other person is replying.

The idea that I am thinking is to use AJAX periodically call the Struts action. what API i should use in AJAX to do this call?

View 5 Replies View Related

JQuery :: Refresh DIV With Full Page Refresh?

Aug 11, 2009

How to refresh DIV , without refresh entire page,Am having four DIV ,

DIV1,DIV2,DIV3,DIV4

I want to refresh only DIV! without affecting the DIV3,DIV4 ,

View 8 Replies View Related

JQuery :: Find Ajax Node Value, And Check It Periodically?

Nov 1, 2011

i'm trying check the value for a node that is loaded with ajax, and to check it every certain time (3 seconds). I've come this far, but don't know where to go from here:

//Messenger frame...
<iframe src="http://settings.messenger.live.com/Conversation/IMMe.aspx?invitee=<?php echo $IsUserAvailable; ?>@apps.messenger.live.com&mkt=es-UY&useTheme=true&themeName=blue&foreColor=333333&backColor=E8F1F8&linkColor=333333&borderColor=AFD3EB&buttonForeColor=333333&buttonBackColor=EEF7FE&

[Code]....

I also read of a method called on(); but never know how to use it, because i can't think of the event i should attach to...

View 2 Replies View Related

JQuery :: Link To Another Page And Execute?

Sep 19, 2010

I have created a page "photography.html". When opened a bunch of thumbnails are visible. When a thumbnail is clicked, various things happen: A window with a slideshow slides in and a bigger version of the clicked image is displayed in the slideshow. Now I would like to accomplish the following: When a certain link on another page is clicked, I want to open the page photography.html and open my slideshow as if a thumb would have been clicked there. Is this somehow possible? PS: I have to admit that I am quite a newbie with both javascript and jQuery and maybe thats way over my horizon. Still I am eager to learn.

View 11 Replies View Related

Execute Injection When Loading Page?

Dec 16, 2009

In Chrome, the login page on my schools educational online platform [URL] doesn't remember the login info. So i made a bookmark with this javascript injection, that fills in the info, and focusses on the 'aanmelden' button (='login' in dutch), so that i only have to press enter to continue. Here's the javascript injection:

Code:

javascript: document.getElementById('username').value='23889493984';document.getElementById('password').value='4 42384985';return false;document.getElementById('login').focus();

This works fine but i'd like to make it happen faster. I wish i could let the script be activated instantly when the page loads, so i only have to press enter, or if possible, let the script click the login button itself.

View 6 Replies View Related

Execute JS Function After Page Loads ?

Sep 23, 2010

I have long html/CSS (no CMS or php, etc.) web pages. Some people run away when they see too much content on a page. So I hide the large lower section of the pages and have the user click anchor text to execute simple JS code to change the display from 'none' to 'block' or back to re-hide.

Code:

(BTW my research indicates that search engines do not know the difference between display='none' and normal content, or I would not be hiding content in the first place.)

Within this hidden content, I have anchor text to provide name handles

Code:

So users can click a link and go directly to that section. Within that link I include

Code:

So that works fine within a particular page. But when I want to link to an anchor on another page which is within this hidden content, the browser cannot display the anchor text because it is still hidden.

Is there a way to execute the JS code to change the DOM, changing the display to 'block' on the content of the new page?

I do not see how, because the new page isn't loaded yet, there is no DOM within the browser yet, so how can it be manipulated?

Of course if I was using php I could generate the code with the property set as desired. But for straight up html/CSS/JS pages is this possible?

I get the feeling I am missing something simple here, either a simple solution or the simple fact that this is just an inherent limitation of html.

View 6 Replies View Related

Execute A Function On Page Load Not After?

Jun 23, 2011

I have been trying to work my way around this issue for some time now. I am trying to stop a marquee from scrolling as soon as the page start to load not after. I have been using this to pause the marquee with JavaScript but the command does not execute but after the page loads; after all the html loads.

This is the JavaScript:

Code:
<script language="JavaScript">
window.onload=function(){
myMarquee.stop();
}

[Code].....

With this code the marquee does stop but after the page loads completely so as the page loads the marquee start to scroll and then stops as soon as the page finishes loading but with the first image of the marquee have way out. I need to be able to load the marquee 100% stopped as the page loads so then I can use the buttons I placed to control the marquee.

My question is:

Is there ANY way to completely stop the marquee from scrolling as soon as the page loads??

how to scroll the marquee by click; meaning by every click of the mouse the marquee moves either left or right, would be even better. p.s: Noted that this code does NOT work in FF for some reason. The stop does not work and the buttons don't respond. why in FF they don't work but in GC and IE they do?

View 2 Replies View Related

How To Execute External JS Files After Page Done?

Aug 22, 2002

I have a dynamic (PHP) external JavaScript file. I need to load that file every X seconds and execute its contents, given the the page is already 'Done' (fully downloaded).

How can this be done?

View 6 Replies View Related

Execute When Browser Page Is Closed?

Aug 11, 2010

i want to run a query when the web page is closed.i think i can do this using javascript. when the browser window is closed then a javascript function will execute and the query will execute.

i'm developing jsp application. if the user closes the web window then a query should be executed which will affect the feilds in MySql database.

View 3 Replies View Related

Get Code To Execute Inline Instead Of Jumping To Top Of Page?

Mar 13, 2011

so im working on a piece of jquery/JS which executes (drops down a new div) when you click a link. I have the links setup as

<a href="#" id="d0">Execute 1</a>
<a href="#" id="d1">Execute 2</a>
<a href="#" id="d2">Execute 3</a>

And the jscript detects when d0, d1 or d2 is clicked and executes my script. It all works perfectly, however when you click on a link it will jump to the top of the page as a side effect of the a href="#" I assume?

View 1 Replies View Related

Execute After XMLHttpRequest - Pull Contents From A Php Page

Feb 3, 2010

I got a javascript function to pull contents from a php page, let's call this page B to the actual page, let's call this page A.

As I know when a page gets loaded the javascript on that page won't execute, am I right?

Now I need the javascript code on that page B to get executed. Is that somehow possible?

View 1 Replies View Related

Execute A Script When Browser Page Is Closed?

Aug 11, 2010

i want run a script where if a user closes browser window then it should execute some set of codes.

View 2 Replies View Related

JQuery :: Part Page Refresh - Load Page It Does Nothing Only Blank Page

Feb 1, 2011

[Code]...

when i load page it does nothing only blank page, may have code in wrong place but not sure so can someone show me a working example so i can find out what i'm doing wrong also i would like the part of page to refresh evey 120 seconds is this possibe with jquery?

View 7 Replies View Related

JQuery :: Execute .hide() After Ajax Page Load

Mar 1, 2011

I have a problem hiding elements after ajax respons.

I have a JQuery script:

$(function() {
$(".tab_content").hide();
$("ul.tabs li:first").addClass("active").show();
$(".tab_content:first").show();

[Code]....

onClick event binded on <li> tag with live() works fine. But I need to hide some tags immediately after ajax call. The jquery script is included together with some HTML code in returned HTTPrespons content data. Is it possible to do this without setting css display:none property?

View 2 Replies View Related

Loading Page Completely Before Image Slider Execute

Sep 1, 2010

Is there something in javascript to make sure that the page is completely loaded and the I execute a function in javascript. Because I have a web page that i have an image slider, so if I open this page in same page before (window.location="source") so the page is loading very fast, but if I use window.open, the page will open in a new window but very slow and the slide show begin but I see that the page is still loading the images, so as result no images is shown. I need to execute the function for the images slider after the page had completely loaded.

View 1 Replies View Related

Execute Function After Form Submitted/page Refreshed

Apr 1, 2005

I have a form within an iframe that I want to use to refresh the location of the parent. I am using the form to set session variables that are used within the parent. So in the iframe I have:

<form name="MyForm" method="POST"
action="<?php echo $_SERVER['PHP_SELF'] . '?' . SID; ?>">
And to submit this form I'm using this link:

<a href="javascript: submitform()">Search</a>
Which refers to this script:

<SCRIPT LANGUAGE="JavaScript">
<!--
function loadParent()
{
parent.location.href = "/search_results.php?";
}

function submitform()
{
document.MyForm.submit();
loadParent();
}
//-->
</SCRIPT>

(I think!) my problem is this; it works fine if the MyForm action, i.e. ="<?php echo $_SERVER['PHP_SELF'] . '?' . SID; ?>", completes before loadParent() is executed but if there is a slight delay in the time it takes for the server to do this, loadParent() is executed too early and the input from MyForm is lost.

What I need is to tell the script to wait until the MyForm action has completed, i.e. the page has refreshed, before running loadParent(). I'm sure there are loads of different ways of doing this. Ideally I would like something that detects the page refresh within the iframe (caused by the MyForm action) and not something that relies on a timed delay loop.

View 3 Replies View Related

Countdown To Page Refresh - Put A Short Page Of Copy On Each Address Along With Keywords Before Redirecting The User To Main Site

Aug 22, 2011

Our company own a lot of domains and want to put a short page of copy on each address along with keywords before redirecting the user to our main site. I have been able to get the page to load the main site after the desired time using this code in the head...

<META HTTP-EQUIV="refresh" CONTENT="40;URL=http://webaddress.com/">

That works perfectly, I am now trying to display a countdown timer from 40 seconds down to 0, and on 0 redirect the user. Saying something like "You will be redirected in XX seconds". Is there anyway of doing this? I've been searching google for the answers with no luck and can only seem to find timers that countdown to a set date.

View 13 Replies View Related

Jquery :: Update The Page Content Without Refresh The Page?

Oct 29, 2011

the page url is

Code:
`http://example.com/index.php?main_page=index&Path=<?php echo $_GET['Path'];?>`
there are some contents on the page:

[code]...

View 1 Replies View Related

Refresh One Div In HTML Page And Not The Entire Page?

Feb 8, 2010

I need to refresh one div in my HTML page and not the entire page, is this possible?

View 4 Replies View Related

Page Does Not Refresh

Jul 23, 2005

I'm building a suite of free php applications to create virtual worlds.
My problem is i can't get my file to refresh. Can this be done with
javascript? I would like to have the display and the form be on a single
page..unless this can be done with frames.

The sample application contains 2 files:
a)The php file (with input controls and the embedded world)
b)The embedded world (text file)

1. The php file accepts input from the user
2. The user hits Submit which creates the text file for the world
this works - the text file is created with changes. next the page
should refresh itself and show the world based on the user's input.

Right now steps 1 and 2 work perfectly in the sense that the text file
for the world does get created. however the page will still show the
older version of the text file.

To get the page to refresh properly, i have to hit the reload button on
the browser...this gives me the "this page can't be refreshed without
sending..." alert...but it then refreshes and shows the changes.

the code:

View 1 Replies View Related

How To Refresh The Page?

May 23, 2007

<img src=...Onlick = "if (!(this.temp>=640)) { this.temp=640; } if
(this.width>=640) { xyz=this.width; this.width=this.temp;
this.temp=xyz; }">

Inline script....
I got the above code from internet and it is used to change the width
of the IMG element. This not only "changes" the width but also
"refreshes" the page so that I can see the change in width.

Function script...
I moved above inline script to a JS file and it is as follows. Now,
'width' of the IMG element seem to change but display does not get
refreshed; and if I add a window.alert( ); then I see screen
refreshing Code:

View 2 Replies View Related

Page Refresh Help

Apr 26, 2006

Page1 is the main page and when I click on a link on page a pop up window opens (page2).What I would like to happen is when page2 is closed I would like page1 to be refreshed.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved