[Solved] Refreshing Just A Div With Codeigniter |
On my script I am able to submit my query form and then it refreshes the div OK
How ever it only seems to refresh once if I click it multiple times will not refresh Any suggestions on what best way is? Code: if (response.success == true) { Code: <script type="text/javascript">
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
If you remove the html then the click function associated with it is also lost. Do you not just have to reapply the click function? (Assuming here you are applying the click function after page load).
(10-12-2016, 03:46 AM)PaulD Wrote: If you remove the html then the click function associated with it is also lost. Do you not just have to reapply the click function? (Assuming here you are applying the click function after page load). Unsure what you mean. It submits the form then if success it should refresh the div each time I click on button. How ever it only refreshes div once for some reason?
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
It seams you are doing 2 request to the server the ajax post and load in the success handler.
Would it not be better to return the updated content of the div with the ajax response Some thing like this: Code: <script type="text/javascript"> Your php method echo a json_encode($result_array) A good decision is based on knowledge and not on numbers. - Plato
You should debug the script. So you can have clear, where it stops working.
Log Click Event, Success and Error Response, Data Value... There could be a lot of issues, that are could cause it.
Solution now found http://stackoverflow.com/questions/39997...6#39998126
Have had to add Code: $('#rep').on('click', '#vote-up-icon', function(e) { Code: <script type="text/javascript">
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |