| | |
javascript table
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jun 2007
Posts: 15
Reputation:
Solved Threads: 0
Hi,
I have an html page which is designed using tables. I would like to know that if I click on a button located in one cell of the table, it should open another page in a new cell of a different table without refreshing the entire page. I tried using ajax, but nothing seems to be happening.
Please help.
Thank you in advance
Saswati
I have an html page which is designed using tables. I would like to know that if I click on a button located in one cell of the table, it should open another page in a new cell of a different table without refreshing the entire page. I tried using ajax, but nothing seems to be happening.
Please help.
Thank you in advance
Saswati
•
•
Join Date: Jun 2007
Posts: 15
Reputation:
Solved Threads: 0
•
•
•
•
'Doesn't work' is a very generic. You need to come up with a specific problem if you want help. There are loads of AJAX tutorials out there, just read a few of them and if you are still stuck, post your code here.
I understand that very much. Let me give you a part of the code to help you understand my problem.
This is the table cell which when one clicks
<td width="33%" style="text-align: center;"> <a href="javascript
isplayAlertTable('maincontenttable','AlerttablePage.html');" id="alerts"> Alerts </a> </td>should display the requested page in the table
<table width="100%"><div id="maincontenttable">
<tr>
<td colspan="2" width="100%" align="center"><!-- START Script Block for Chart Rotating Pie-->
<div id="RotatingPieDiv" align="center"> Dashboard appears here. </div>
<script>
var jobProgressChart = new Charts("RotatingPie.swf", "RotatingPie", width, ht, "0", "1");
jobProgressChart.setDataXML("<chart></chart>");
jobProgressChart.render("RotatingPieDiv");
</script>
<!-- END Script Block for Chart RotatingPie-->
</td>
</tr>
<tr>
<td width="80%" style="text-align:right; horizontal-align:right;" >
<Button id="ShowResourceUtilizationButton" onclick="showResourceUtilization();">Resource Utilization View </Button>
</td>
<td>
<Button id="JPViewButton" onclick="showJobProgressView();">Job Progress View </Button>
</td>
</tr></div>
</table>
and the javascript function is
/*function DisplayAlerttable(id,url)
{
var req=false;
var width = windowWidth * 0.50;
var ht = windowHeight * 0.70;
if (window.XMLHttpRequest)
{
req=new XMLHttpRequest();//for non-IE browsers
}
else if(window.ActiveXObject)//for IE
{
try
{
req=new ActiveXObject("Mxml2.XMLHttp");
}
catch(e) {
try {
req=new ActiveXObject("Microsoft.XMLHttp");
} catch(e){}
}
}
else
return false;
}
if (req)
{
req.onreadystatechange= function()
{
loadpage(id,req);
}
}
req.open(GET,"AlerttablePage.html",true);
req.send(null);
}
function loadpage(id,req)
{
if(req.readyState==4)
{
if(req.status==200)
document.ajax.dyn="Received" + req.responseText;
else document.ajax.dyn="Error:" + req.status;
}
} */
Nothing happens. Please let me know where the mistake is.
Thanks a lot in advance
Saswati
•
•
Join Date: Jul 2007
Posts: 17
Reputation:
Solved Threads: 1
I know this will work. Use iframes.
In the table that you want the new page to pop up (or into) place an iframe name it and you can now update it with javascript.
Like this
the in the javascript:
If you want the page loaded to be dynamic then you can use the write funtion of document.
ie)
iframes default to this ugly thing with scroll bars and borders, but all that can be eliminated with css, look it up. You do have google right?
Hope this helps
lemeno
In the table that you want the new page to pop up (or into) place an iframe name it and you can now update it with javascript.
Like this
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<td><iframe name="theName"></iframe></td>
the in the javascript:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.all.theName.location="the separate html file to load";
If you want the page loaded to be dynamic then you can use the write funtion of document.
ie)
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.all.theName.write('whatever');
iframes default to this ugly thing with scroll bars and borders, but all that can be eliminated with css, look it up. You do have google right?
Hope this helps
lemeno
Last edited by Kelicula; Jul 2nd, 2007 at 7:20 pm.
•
•
Join Date: Jun 2007
Posts: 15
Reputation:
Solved Threads: 0
•
•
•
•
I know this will work. Use iframes.
In the table that you want the new page to pop up (or into) place an iframe name it and you can now update it with javascript.
Like this
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<td><iframe name="theName"></iframe></td>
the in the javascript:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.all.theName.location="the separate html file to load";
If you want the page loaded to be dynamic then you can use the write funtion of document.
ie)
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.all.theName.write('whatever');
iframes default to this ugly thing with scroll bars and borders, but all that can be eliminated with css, look it up. You do have google right?
Hope this helps
lemeno
Thanks a lot. My problem is solved
Saswati
![]() |
Similar Threads
- expanding table in flash/javascript required (JavaScript / DHTML / AJAX)
- PHP mysql drop down populates another drop down (PHP)
- Change left-border of a table cell with javascript (JavaScript / DHTML / AJAX)
- Javascript Problem (Windows 95 / 98 / Me)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Smart chained select boxes
- Next Thread: Help with hyperlinks!
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array browser bug captchaformproblem cart checkbox child class close codes createrange() css cursor date debugger decimal dependent design disablefirebug dom dropdown editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe images index internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl listbox maps masterpage math media menu mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php position post problem programming progressbar prototype redirect runtime safari scale scriptlets scroll search security shopping size software toggle unicode w3c web wysiwyg \n






