Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question jQuery/Ajax Login Form - Best Approach?

    I need to build a login box that satisfies the following:

    Requirements:
    1. Build this as a UI Component that can be used in multiple locations in your site
    2. Two instances of this component can exist on the same page
    3. You can use jQuery, HTML5 and CSS3
    4. Your site supports IE9+ and current versions of Safari, Chrome, Firefox
    5. Your site supports iOS6


    UI Specifications:
    • Login form submits username and password data using AJAX to: api.yoursite.com/login
    • Both form fields must be entered (not empty), otherwise display an alert message.
    • If login succeeds, display in the browser JS console the “succeeded” message.
    • If login fails, display in the browser JS console the “failed” message.


    Questions I have:
    - Should I assume api.yoursite.com/login is part of the same domain? In my first attempt, I did the opposite and tried to submit the data using JSONP, which would NOT work.
    - If I'm only able to use jQuery, HTML and CSS, how should I account for a server-side language? And how could I set something up locally on my machine for testing purposes? My previous attempts have been unsuccessful.

    I'm getting down to the wire here and would greatly appreciate any pointers. Thanks!

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,690
    Thanks
    25
    Thanked 656 Times in 655 Posts
    Quote Originally Posted by manh2244 View Post
    Should I assume api.yoursite.com/login is part of the same domain?
    Yes!

    Quote Originally Posted by manh2244 View Post
    ... I did the opposite and tried to submit the data using JSONP, ...
    Your specs say
    Login form submits username and password data using AJAX to: api.yoursite.com/login
    Quote Originally Posted by manh2244 View Post
    If I'm only able to use jQuery, HTML and CSS, how should I account for a server-side language?
    Not specified. Use what ever you want, because a server-side language is needed.

    Quote Originally Posted by manh2244 View Post
    how could I set something up locally on my machine for testing purposes?
    Use WAMP(unless your on a mac)
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •