Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Obfuscated Javascript?
Message
De
15/02/2013 19:14:00
 
 
À
15/02/2013 15:07:59
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01566169
Message ID:
01566211
Vues:
52
A couple of highly recommended time-savers :

Get thee to Pluralsight. Very very very good instruction in all facets of jquery, knockout ( the binding library) and pretty much everything else. Pop for the full $50 a month to start to get the source code. Just for John Papa, Greg Allen and Julie Lehrman's stuff it is embarassingly underpriced.

Second, google jsfiddle and go play there.

jQuery in general is pretty much a must for using javascript on web now but it is all the other libraries that make it so very very cool.

I think it is also an area where old loosely typed anything goes VFP programmers have kind of an edge as things that puts a c# - Pascal programmer's teeth on edge are a whole lot less scary to us. And even better if you then have programmed C# and learned the virtues of some structure you're in a very good position to write *good* javascript and recognize which of the current crop of gurus are steering you in the right direction.


>Thanks.
>
>No, just getting started with JavaScript. Quite a few sources seem to recommend jQuery as a good Javascript framework.
>
>>It sets the value of EntryCode to AccessCode + a formatted date from the date picker + "00000" + a slice of the check number. slice is documented at http://api.jquery.com/slice/
>>
>>Are you familiar with jQuery?
>>
>>>Here's some code from a page that gets and validates 3 variables - numeric Access Code and Cheque Number, and a date chosen from a date picker. I think I follow most of the code; the lower part first checks that the values are not blank. If they are not, it then runs a line of code I don't understand, then returns true.
>>>
>>>What does that line do? ( the one that ends in .slice(-5) )
>>>
>>>
>>><script type="text/javascript">
>>>    $(document).ready(function () {
>>>        $("#ChequeNumber").numeric({ decimal: false, negative: false });
>>>        $("#AccessCode").numeric({ decimal: false, negative: false });
>>>    });
>>>
>>>    $('#datePicker').bind('datebox', function (e, passed) {
>>>        if (passed.method === 'close') {
>>>            $('#VisitDate').val($('#datePicker').data('datebox')._formatter('%m/%d/%Y', $('#datePicker').data('datebox').theDate));
>>>        }
>>>    });
>>>
>>>    $(document.forms[0]).submit(function () {
>>>        if ($("#ChequeNumber").val() == "") {
>>>            $(".error").html("Cheque # is not a recognized number.");
>>>            $("#ChequeNumber").focus();
>>>            return false;
>>>        } else if ($("#VisitDate").val() == "") {
>>>            $(".error").html("Please enter your date of visit and try again.");
>>>            $("#VisitDate").focus();
>>>            return false;
>>>        } else if ($("#AccessCode").val() == "") {
>>>            $(".error").html("Access code is not a recognized number.");
>>>            $("#AccessCode").focus();
>>>            return false;
>>>        }
>>>        else {
>>>            $("#EntryCode").val($("#AccessCode").val() + $('#datePicker').data('datebox')._formatter('%m%d%Y', $('#datePicker').data('datebox').theDate) + ("00000" + $("#ChequeNumber").val()).slice(-5));
>>>
>>>            return true;
>>>        }
>>>    });
>>></script>
>>>


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform