#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Question Complex JS Assigment


    Hi there everyone!

    I have a couple things I need help with and I'm very new to javascript as I'm taking a class on this right now. We have an extra credit assignment that I'd really like to have. It's meant to be fairly vague and open for interpretation. Here's what it says:

    == Write a jQuery plugin that serves as a DOMElement factory with supporting HTML/CSS
    You have a web application that adds orders to carts. Items in the cart can be displayed on a dedicated cart page, in a modal/dialog with cart contents, and in an expandable menu from a fixed footer (open to interpretation). These item lists should be detailed, somewhat informative, and summarized (respectively and based on context, so the 'expandable menu' should be minimal while the dedicated 'cart page' should have the most detail). The jQuery plugin should use the same method(s) to add items to each instance of the cart contents without the use of parameters that identify the context of the list that the item is being added to. HTML/CSS can be minimal and only needs to support displaying the items in a rudimentary (but functional) way.

    == Write a small Javascript application that does not expose any logic to the end user
    While there is no such thing as "secure Javascript", adding objects to the global namespace is typically a Bad Idea. However, sometimes scope presents problems interfacing with objects outside of that scope. Create a Javascript object/context that does not expose itself globally but is still able to be interacted with by other objects out of scope (open to interpretation) while maintaining application integrity.

    == Create a simple HTML page that saves state
    Sometimes a page requires a lot of application logic that changes the contents or functionality of the page drastically from its initial state. In this instance, instead of needing to reproduce steps to achieve the same results on subsequent pageloads, the page should effectively save its state so that reloading the page will not have an adverse effect on its contents or functionality. Page contents are arbitrary and left up to you.

    We only have to do 2 out of the three options. Ideally I'd like to combine at least 2 of them into one document and make it an awesome assignment. If there's a way to combine all 3 that'd be even more awesome. Can you guys point to resources that ideally already have most of this created so I just have to merge it together and maybe make some of my own little markup? Or would it take very long for someone here to do 2 of these for me really quick? If the latter is an option, I'm willing to pay a little bit of money for your time.

    Thanks!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0
    No help at all??
  4. #3
  5. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,122
    Rep Power
    4258
    Welcome to DevShed Forums, cmulletman.

    For the first, here are some articles on creating a jQuery plugin:
    http://docs.jquery.com/Plugins/Authoring
    http://remysharp.com/2010/06/03/sign...jquery-plugin/
    Style in jQuery Plugins and Why it Matters

    For the second, you will need to learn about variable scope in JavaScript:
    Scope in JavaScript
    http://blog.morrisjohns.com/javascri...es_for_dummies
    http://www.jibbering.com/faq/faq_notes/closures.html
    http://robertnyman.com/2008/10/09/ex...-and-closures/
    Private JavaScript

    For the third, you can use cookies or HTML5 localStorage. The advantage of localStorage is that more space can be used than cookies provide, however, not all browsers in current use support it.

    P.S. New users are restricted from posting URLs until they have made 5 posts. You may need to get around this by leaving out the "http://" and putting a space before each ".". Yes this rule is annoying, but the administrators say it's necessary for limiting spam.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0
    Awesome, That's a great start for me. Thank you!

IMN logo majestic logo threadwatch logo seochat tools logo