Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Posts posted by jimfog

  1. I am using this tutorial here http://blog.shinetech.com/2011/08/05/building-a-shared-calendar-with-backbone-js-and-fullcalendar-a-step-by-step-tutorial/ to make a calendar using backbone.

     

    The calendar is rendered via backbone with a function(see paragraph Bringing in Backbone code line 15).

     

    The problem is that the calendar is not displayed/rendered.

    Checking with the chrome devtools console I saw the following error:

     

    Uncaught TypeError: Cannot call method 'each' of undefined

     

    It refers to backbone-min.js and to this code here

     h.each(_, function(t) {        v.prototype[t] = function(e, i) {            var r = h.isFunction(e) ? e : function(t) {                return t.get(e)            };            return h[t](this.models, r, i)        }    });

    Why that happens? I have not the slightest idea.

    What could be possible wrong here?

  2. Ok...I have one question that needs answering.

    What is the reason for using bind anyway since to call an object method we just use the object notation(object.method).

     

    This is a general question about binding and what it means in javascript overall.

    Reading jquery documentation,it says, that it is NO LONGER the preferred method for attaching event handlers.

     

    In fact I use $("#savepersonal").click(function(e)....type of code.

     

    So, I am repeating the above question...what is the reason using it if we are going to call the method with the usual object dot notation

  3. I am making a web app where the user will be able to use a calendar to store appointments in the database.

    The question is what type of column that must be that will store the appointment time.

     

    Without having thoroughly researched the issue my understanding is that it must be of the date/time format.

    But I am not sure if this is the right choice-could STRING be also a solution here?

  4. I am reading this tutorial here on how to use backbone.js along with the jquery fullcalendar plugin to build an events calendar:http://blog.shinetech.com/2011/08/05/building-a-shared-calendar-with-backbone-js-and-fullcalendar-a-step-by-step-tutorial/

     

    Ιf you see the code listed in the chapter named Bringing in Backbone...you will see in line 11 _.bindAll(this);

     

    Despite having being read about the above in http://underscorejs.org/#bindAll I still cannot understand what it does.

    I would expect that inside the parentheses some method/s would be listed, we find in it this.

     

    Some help would be welcome here...I am trying to build an event(appointments to be precise) calendar here and know exactly what the code does is something that is needed.

  5. One issue that is raised is localization. I want the calendar to be in Greek.

    Now...of course it is in English. What can I do about it?

     

    The documentation does not mention anything about localization.

     

    I found a solution to the above problem.

  6. Here is a question I always had and now is the opportunity to ask.

    If someone wants to write PHP code, what is it better, using a php file extension or an html file extension and just put the

    php code in there-in between the corresponding tags of course.

  7. Aren't there a bunch of jQuery calendar plugins available? Like this one...

     

    http://arshaw.com/fullcalendar/

    I saw this plugin.seems to be the right choice for the job.What seems interesting though is that the "view" is totally left to js, no PHP involved.

    PHP will be involved probably only when storing events to the database or selecting from it.

     

    As I see my approach was wrong, in my PHP calendar the "view" was also "taken care" by PHP.

  8. well...the point to make is that I am trying to find a calendar library/plugin/framework that provides the same functionality with one found in outlook.com or google calendar(I do not think these two differ a lot, at least when it comes to their core functionality).

     

    Adding/deleting/changing events plus some custom code.But I must have a basis to work on.

    I have made a calendar in PHP but lacks the interactivity of aforementioned.

     

    IT IS NOT state of the art as you can imagine.... this PHP calendar.

    I need a calendar here that has full AJAX support and...kind of a modern js application.

  9. well...I see many files there, none of which seems to be related any framework.

    I also found this,-which is of particular interest:

    x-jquery

    It seems to be a templating system relative to jquery...I know nothing about it and it is the first time I see such thing.

    Any comments are welcome.

    I mean in case you manage to reach any conclusion regarding the code you see in the script tags.

    To me it seems custom code-not any framework used.I am not sure though

  10. I would like to build a calendar similar to outlook.com. The first step I am doing to "decrypt" its functionality is to find out libraries that it is using.

    It is difficult to do so though-I am just seeing the source of the page, without concluding anywhere though.

     

    So, can you understand what libraries/frameworks are being used there(backbone, jquery...other)?

  11. I am reading about multi-query in the manual and what I have noticed is that they are used primarily with SELECT statements.

     

    What about UPDATEs,INSERTS etc?

     

    There is an example with INSERTS but it is provided by a user.

     

    WHat is your experience regarding the above?

  12. YES...THE JQUERY CODE WORKS AS INTENDED.

    The mistake was the code was placed above the script tags that call the jquery library into the script-it was a naive mistake of mine.

     

    Now to see that the code works also with the session variable.

  13. forget for now the code on post 21.

    How am I going to make the function above print also the PHP code?

    I am confused.

     

    Let me think a while and I will post again if needed.

     

    STILL CANNOT MAKE THE CODE WORK IN POST 21.

     

    give me a moment I am on to something.

  14. before investigating the session start issue-which by the way hadien is right in mentioning- I want to comment the below code a little:

     <script>    function doOnLoad(){       document.write('hi');        <?php echo 'john'; ?> }    doOnLoad();  </script>  

    And what is the result of the above?

    Hi is printed on the browser, while john is NOT printed.

     

    Can someone comment that. Is the above wrong?

    Putting PHP inside a js function.

     

    Because if the above is impossible than the session code presented in post21 is useless.

  15. In the beginning your code worked as EXPECTED.Afterwards something went wrong and I cannot find what.

    Here is your code:

     <script>    function doOnLoad(){ <?php if(isset($_SESSION['verified'])){       unset($_SESSION['verified']); ?>       //this section of code will be added ONLY if the php finds that SESSION variable  $('#confirmcontent').html('email confirmed');      $('#confirm').reveal({      animation:'fade',        animationspeed:600,        closeonbackroundclick:true              });<?php } ?> }    doOnLoad();  </script> 

    and here is the redirection code in the php script that handles verification:

    if($change=email_change_data($conn,$nonce)==true)//this function verifies the email{   $_SESSION['verified']=true;      header("Location: http://localhost/Appointments/Administrator/profile.php?formverified");//redirection takes place}

    Do you see anything wrong in the above segments....cause I don't.

  16. go to twitter.com and use a browsers web inspector to view all the cookies set under that domain.

    Difficult to identify which cookie(if any) is related with seeing the modal or not.

    Many cookies from twitter.

  17. You are right...I had made a silly mistake :facepalm: , when I was calling the function was with a different nonce from the one found in the db.

     

    Sorry...

  18. If you have this line:

     

    $expirystatus=$result->fetch_object();

     

    and you are expecting that fetch_object might return null, then why would your next line be this:

     

    $expire=$expirystatus->nonce;

     

    If you think that $expirystatus might be null, then why are you trying to get a property of it instead of checking if it is null?

     

    I tried this code:

     else{$expirystatus=$result->fetch_object();        if($expirystatus===null)        {$expire='expired';}         else        {$expire='non-expired';}     var_dump($expirystatus);      }

    and I saw that expirystatus is NULL either way...nonce expired or not.

     

    Any suggestions?

  19. yes location.search did the job. The logic is that when location.search===querystring, then fire the modalbox(using a js library of course).

    But here is the problem now. I want the above to take place once, now though it happens every time I refresh the page.

     

    The aim is that the modal appears only once as in twitter.

     

    What can be done here?

    PHP code:

    header("Location: http://localhost/Appointments/Administrator/profile.php?formverified");//redirection took place

    js code:

    if(location.search==='?formverified'){    $('#confirm').reveal({//the modal fires here      animation:'fade',        animationspeed:600,        closeonbackroundclick:true              });}
  20.  

    Because the query didn't return any results.

     

    Ok, what can I do here? As I said if the nonce is expired no result will be returned by definition.

    Is there a workaround?

    What conditional can I write that test if none result is returned...

     

    if(none result returned)

    {nonce is expired}

×
×
  • Create New...