thanks my friend u are right .. but everithing else looks ok.

2013/4/3 asgallant <[email protected]>

> The PHP function is json_encode, not jsonencode.
>
>
> On Wednesday, April 3, 2013 5:31:22 PM UTC-4, Chrystopher Medina wrote:
>
>> my friend it works perfectly thanks..... my friend i have anoter cuestion
>>
>> well i have a form and i send my data to the server in order to check if
>> the user and passwor are ok.
>> i do this jus to test.
>>
>> thi is my php file
>>
>> if($_post['user']=='xhava' && $_post['password']=='12345'){
>> echo 1;
>> }else {
>> echo 0;
>> }
>>
>> and in my javascript file i jus have this
>>
>> well i have mi function in order to send the data to the server and in
>> order to receive the values i do thi
>>
>> function(data){
>> if(data===1){
>> alert("you have logged");
>> }else{
>> alert("you have not logged in ");
>> }
>> }
>>
>> but how i can send from my php file to the javascript file the data in
>> json format......
>>
>> i had done somethin like this but it did not work.
>>
>> $myarray = array();
>>
>> if($_post['user']=='xhava' && $_post['password']=='12345'){
>> $myarray[0] = 1;
>> }else {
>> $myarray[0]=0;
>> }
>>
>> echo jsonencode($myarray);
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 2013/4/3 asgallant <[email protected]>
>>
>> Like most things, sessionstorage and server sessions have their benefits
>> and drawbacks, and which you use largely depends on what you need to
>> accomplish; neither one is inherently better than the other.  Basically,
>> the difference as I understand it is that PHP's sessions tie data to a
>> particular connection to the server for the duration of the session while
>> sessionstorage keeps data locally in the browser, tied to a particular tab
>> and a particular domain.  If you need to access the data to do things on
>> the server, you probably want to use PHP's sessions; if what you want to do
>> is all in javascript, then you might want to use sessionstorage.
>>
>> As far as the other problem you are having goes, I can't be certain of
>> the cause without being able to test it.  My suggestion would be to move
>> any jQuery that acts on the content in secondpage.html into
>> secondpage.html, and wrap it in a document.ready event handler:
>>
>> $(function () {
>>     // javascript that does things on the contents of secondpage.html
>> });
>>
>>
>> On Wednesday, April 3, 2013 7:49:31 AM UTC-4, Chrystopher Medina wrote:
>>
>> my friend could you explain me something please.. look,  i have my
>> index.html some like this:
>> <script>here is the jquery library </script>
>>
>> <script>
>> window.addEvenListener('load',****inicia,false);
>> function inicia(){
>> $("#firstbutton").on('click',**f**unction(){
>> $("content").load('secondpage.****html');
>> });
>>
>> $("#secondbutton").on('click',****function(){
>> alert("i am the second button");
>> });
>>
>> }
>> </script>
>> <div id="content">hellow world</div>
>> <input type=button value=ok id=firstbutton>
>>
>> and then i have another file html named secondpage.html
>> this file has something like this:
>>
>> <div>this is the second page</div>
>> <input type=button value=ok id=secondbutton>
>>
>> well, i have my javascript file just in the first page(index.html) and
>> when i click in the button id=firstbutton, the second page named
>> secondpage.html is loaded inside my index.html in the div with
>> id=content.. until here everything works fine..but
>> but when I click on the second button in my second page does not show me
>> the alert("i am the second button")
>>
>> I thought I just had to include the jQuery library and the script
>> javascript in my index.html and as the second page is being loaded into my
>> index.html, this second page could run the scripts included in my index.
>>
>> i hope u can explain me this.
>>
>>
>>
>>
>>
>>
>>
>> 2013/4/3 Chrystopher Medina <[email protected]>
>>
>> could you gime some diferences between both of them
>>
>>
>>
>> 2013/4/3 Chrystopher Medina <[email protected]>
>>
>> my friend u think that is better that i use sessionstorage from html5 or
>> sesions with php
>>
>>
>> 2013/4/2 asgallant <[email protected]>
>>
>> The first two header lines tell IE not to cache the results (you may or
>> may not want to include them, depending on whether you want caching enabled
>> or not).  The last one helps the browser interpret the data, and looks
>> correct if you are returning a JSON string.
>>
>>
>> On Tuesday, April 2, 2013 4:05:56 AM UTC-4, Chrystopher Medina wrote:
>>
>> mi friend could you explain me this again please.
>>
>> header('Cache-Control: no-cache, must-revalidate');
>> header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
>> header('Content-type: application/json');// well this is to tell to the
>> script that json is the type of data that im gonna send ... am i ok ?
>>
>> because i´ve forgot it ... about jquery with ajax i´ve been studing a lot
>> , and i think that i´m learning a lot abount that.
>>
>>
>> 2013/3/27 Chrystopher Medina <[email protected]>
>>
>>
>> please my friend. for example....
>>
>> this is a button ...              and when i click on it .... i want to
>> go to the php script, and obtain values from my database... then i want to
>> <div  id="values"></div>     send the values to the div with id=values
>>
>>
>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Google Visualization API" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/**to**
>> pic/google-visualization-**api/-**zapZe7dH7Y/unsubscribe?**hl=en<https://groups.google.com/d/topic/google-visualization-api/-zapZe7dH7Y/unsubscribe?hl=en>
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> google-visualization-api+**unsub**[email protected].
>> To post to this group, send email to google-visua...@**googlegroups.**com
>> .
>>
>> Visit this group at <a href="http://groups.google.**com/group/google-**
>> visualization-api?hl<http://groups.google.com/group/google-visualization-api?hl>
>>
>> ...
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Visualization API" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-visualization-api/-zapZe7dH7Y/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to