php - Tweak a URL and make the JQUERY trick work FULL CODE 100% FINISHED -


well, scenario may familiar because ve been @ quite while though closer ever still has never worked. going put extremely clear , detailed definitively nail it.

scenario

we have 1 long url line upon clicking 2 things should happen @ once (the current situation ony happens 1 of them 1 or 2)

1) jquery sensitive click , opens slide panel

2) same jquery has line makes div inside panel populated (thanks php sql powered file)

so, issue line. 2 have been proposed, none trick 1 , 2 mentioned above. although both syntactically correct, is, order of dots , quotes correct, none of lines opens slide , and populates div.

1st line proposed:

this line lets slide panel open not transmit id_cruise value

$soutput .= '"<a href=\"#\"' .' id=\"' .addslashes($arow['id_cruise']) .'\" class=\"flip\">'.addslashes($arow['from_country']).'</a>",'; 

2nd line proposed

this line not open , not populate either div box inside panel, (you can see shaking of panel was, though doesnt open). if @ line, seems me, there id not need there, twice says both id = id_cruise....

$soutput .= '"<a href=\"?id=' .addslashes($arow['id_cruise']) .'\" id=\"' .addslashes($arow['id_cruise']) .'\" class=\"flip\">'.addslashes($arow['from_country']).'</a>",';  

and jquery snippet should activated click of link , passing of parameter this

<script type="text/javascript">  $(document).ready(function(){ $('a.flip').live('click',function(){     $(".panel").slidetoggle("slow");  $('#reviews').load('sendidtodatabase.php', {id_cruise: this.id});   }); });  </script> 

an alternative snippet proposed yesterday, problem same

<script type="text/javascript">  $(document).ready(function(){ $('a.flip').live('click',function(){     $(".panel").slidetoggle("slow");      dosomethingwith(this.id);      }); });  </script>   <script type="text/javascript"> function dosomethingwith(id) {   $.get("sendidtodatabase.php", {id_cruise:"id"}, anotherfunction); } function anotherfunction(str) {  $("#reviews").html(str);                                                 } </script> 

so, it. visualize how works. imagine table. well, click on link , table goes down slide panel opens up. inside panel there div, that, see, loads content of php file called sendidtodatabase.php

update

well issue, see in answer not on link in 1 line of jquery snippet, 1 forwards value sql php script. had double quote on , send value literal letter. quotes not make difference. definitively tell did difference in world. besides that, out of 2 links proposed, first 1 works, other 1 not open slide panel.

update of update

guffa or göran insightfully pointed out second line open panel, happened (managed know without seeing visually!) page reloaded again before panel finished displaying. believe, replied in comment, that due double repetion of 1 part of line, one

'\" id=\"' .addslashes($arow['id_cruise'])  

so, either remove part, of use first line. used first line.

well, reason value not being passed on, there double quotes on id there should have been none, here id_cruise:"id" created print id_cruise in php script see if ever received value indeed, , guess received ? id.

that it. take quotes out , have variable , not literal. that, so, dont know if simplified snippet works, dont want try. choose 1 jeff looks designed in sense can see logical succession of events there should not reason why not work. jason morning perfect syntax of long line , million helped tried help. night


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -