0

I have a page calling another page using :

$("#Go").click(function () { 
    $("#view").load("test.php");
    refreshId = setInterval(function() { 
    $("#view").load("test.php"); }, 1000);  
});

This works fine.

The question I have is can test.php use jquery to update a checkbox on the parent page ?

JeffVader
  • 702
  • 2
  • 17
  • 33
  • 1
    once test.php loads then it will be the part of parent page DOM. you can write your logic of changing checkbox on parent that will execute on the completion of test.php. so in other words it can modify the page – muneebShabbir Jun 10 '13 at 10:40
  • thanks, how from test.php do I update a checkbox with the id="mail" ? I want to untick it ! – JeffVader Jun 10 '13 at 11:19

1 Answers1

0

You can use the callback function for this

$('#view').load('test.php', function() {
    // manipulate your DOM
});

Read Docs http://api.jquery.com/load/

Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106
  • Thanks, not sure how I would untick a check box based on what is happening on test.php ! ? – JeffVader Jun 10 '13 at 11:05
  • In `test.php` you can return `true` or `false`, on the basis you can `tick` `checkbox` or `untick`. – Rohan Kumar Jun 10 '13 at 11:12
  • In test.php appeart from updating a database, I'm check the size of a mailserver log file. If it's over xx I want to disable the checkbox on the parent ! This doesn't seem to work. – JeffVader Jun 10 '13 at 11:15