Dashcode - Add HTML

Discussion in 'Web Design and Development' started by dylanbrown, Jul 8, 2009.

  1. dylanbrown macrumors 6502

    Aug 20, 2008
    Hey all,

    I have been messing around in Dashcode recently, and came across something I wanted to do, but couldn't figure out how...

    I want to add a little bit of HTML Code on the back of the Widget - and I'm wondering how I could accomplish this - Thanks...

    Edit: I also wanted a way to "Check for an Update". I have added a button that displays a web page saying Version x is the most recent version, but wondered if there was a way in the Widget to say "You have the most recent version"... is that possible, thanks.
  2. Ride9650 macrumors 6502

    Jun 29, 2007
    I might be wrong about this seeing as how I've only kinda explored dashcode, but I don't think its possible to add your own HTML.

    As for your other question, I take it you want to keep it online?I'm just making this assumption since you want to use HTML.

    Well, in any case, making a web app wouldn't require version checking, since every time the user loaded it up, the most recent version with any new changes would pop up.

    If thats not the case, then one way to do it would be to do it like this(this is using javascript since I believe thats all DashCode can handle)

    Set up a variable with the value being the current version
    var currentVersion = 1.0;

    as you release updates, make sure to change the value of the variable.

    In the program you would make a function that checks for updates. This could run every time the program connects to the internet. It should pass the value of the version that the current user has, so lets say that the user currently has the ".05" version of your program.

    For him/her, the variable currentVersion would read ".05".

    So you will need to pass that value into your function. Before that though, it might be useful to make another variable with that ".05" value just so things dont' get confusing. Lets say we assigned that value into a variable called
    var userVersion = .05;

    Next we call the function:

    function updateCheck(userVersion){
    alert("There is a new version available. Please download here");
    }else if(currentVersion==userVersion){
    alert("you have the most recent version");

    This is just the basic principle behind version checking, I'm not sure if widgets can handle alert functions or not, and like I said, I've only kinda explored Dashcode, so I'm not sure how the workflow is structured, but this should give you enough of an idea on how to do version checking.
  3. dylanbrown thread starter macrumors 6502

    Aug 20, 2008

    Thanks ever so much for that informative answer! I wasn't expecting anything detailed, and didn't know much about version checking/alert functions so thanks!

    As for the HTML - I don't know if Dashcode supports it or not, it was just for a little banner that was gonna be placed on the Info pane - nothing too much.

    Thanks again for your informative answer!

Share This Page