claro Posted January 27, 2013 Share Posted January 27, 2013 How can I rewrite my code below if my 'data_select.php' is in a variable $data = dataselect, that when it is set to true the data_select.php will show. I'm making a dynamic content in php and I'm not familiar with jquery. Any idea? thank you in advance. <script type="text/javascript"> $(document).ready(function() { $('a').click(function(){ $.get('data_select.php', {'page':$(this).text()}, function(data){ $('#content').html(data); }); }); }); </script> When I try firebug, the error says 'data_select.php' not found. Quote Link to comment Share on other sites More sharing options...
trq Posted January 27, 2013 Share Posted January 27, 2013 I don't understand the question. Quote Link to comment Share on other sites More sharing options...
claro Posted January 27, 2013 Author Share Posted January 27, 2013 Ok. thank you for pointing that out. I'll try my best to explain it further. I have this page called lab_list.php <li><a href='home.php?mountlab=viewLab' target = _top>Laboratories</a></li> <li><a href='home.php?mountlab=setLab' target = _top>Mount Lab</a></li> and it will go to my home.php if(isset($_GET['action']) ) { $test = $_SERVER['DOCUMENT_ROOT'].'/devices/device_coffin'; } else if (isset($_GET['mountlab'])) { $test = $_SERVER['DOCUMENT_ROOT'].'/lab/lab_coffin'; } else { $test = $_SERVER['DOCUMENT_ROOT'].'/welcome'; } and pass me in lab_coffin.php. In this page, I have to columns, the sidebar and its content. What ever option in my sidebar, it's action will display in the content. if (($_GET['mountlab']) == "setLab") { $test = $_SERVER['DOCUMENT_ROOT'].'/lab/set/lab_add.php'; }else if (($_GET['mountlab']) == "setLabAct") { $test = $_SERVER['DOCUMENT_ROOT'].'/lab/set/lab_addaction.php'; }else if (($_GET['mountlab']) == "setLabact2") { $test = $_SERVER['DOCUMENT_ROOT'].'/lab/set/data_select.php'; } So when I clicked the mount lab in my list, it will pass me a page where I can select another options. In this page there is a transaction where I'm using jquery ajax..I tried it in a single page and it went well. Now when I try to integrate with my dynamic content, I'm lost. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.