Creating shortcuts in application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bimeldip
    New Member
    • Aug 2007
    • 27

    Creating shortcuts in application

    hi,

    You know like how we open a microsoft word document.Type something in it.Then save it (in this case on the desktop). An icon will appear on the desktop. The next time all we have to do is double click on the icon and it will open our saved document.

    So my question is, can we code javascript/dhtml such a way to perform a function like i described above?

    Thanks
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    hi ...

    all things that you do with javascript are strictly bound to the browser ... you may create a 'browser'-desktop ... that means you create a web-app that looks like a desktop and there you may do whatever you want ... but you cannot do things outside of the browser ... except of writing cookies you don't have access to the client's filessystem ... so you cannot read/write things to it ...

    kind regards

    Comment

    • bimeldip
      New Member
      • Aug 2007
      • 27

      #3
      hi
      what do u mean by
      "that means you create a web-app that looks like a desktop and there you may do whatever you want" ...

      Currently, i have a index.php file where widgets are generated when clicked on links of the files. Can this index.php file be considered my desktop?
      and how do i create functions to create desktop shortcuts after being given a url?

      Thanks

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        Originally posted by bimeldip
        hi
        what do u mean by
        "that means your create a web-app that looks like a desktop and there you may do whatever you want" ...

        Currently, i have a index.php file where widgets are generated when clicked on links of the files. Can this index.php file be considered my desktop?
        and how do i create functions to create desktop shortcuts after being given a url?

        Thanks
        yes ... exactly ... your webpage, when loaded to the browser, is your 'desktop' ... and your 'quasi-runtime-environment' for all javascript-actions ... not at all ... in reality ... it is the browser-window, and your document provides the js-code that may be executed ... but as i said ... js cannot break out of the browser here.

        a 'short-cut' as you call it now ... is simply a link in a webpage ... and you may assign that link to everything you want ... use an icon (image) ... place it an your webpage ... assign an onclick-handler that loads the url you want whereever you want ... or simply create a simple link-list when you need it. i assume you may do something at the page ... that results in creating an url ... and now you want to place a direct link at the page? ... so you may use dom-methods (createElement( 'tag_name'), setAttribute('a ttr_name', 'attr_value') etc.) to achieve that ...

        i hope i made myself clear ... ask for more in case you need an example or something like that.

        kind regards

        Comment

        • bimeldip
          New Member
          • Aug 2007
          • 27

          #5
          Hello,
          Thanks for being so patient with me.But that is exactly what i want to learn.
          From what you say is is safe to say. i create a function "Create Shortcut" that when clicked on, it will generate an image and save the url. So that the next time user clicks on the image, it will open a "virtual window".
          Is it possible if i get examples on how it is done, or any site that offers tutorials for it?
          Thanks a whole bunch.

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            hi ...

            ok ... we need the following things ;) and tell me if i'm wrong ... ok?

            1. doing some action at your page ... results in what? i assume you want to save a state of something ... and you create an url for that and save that too? in case you need that persitstent in the database? is that done already?

            2. now take the url and create your shortcut-control. you may create an image-node with javascript ... but the image-src itself has to be there from where you want it to be loaded ... and of course you may open new browser-windows or (i)frames within your application

            kind regards

            Comment

            • bimeldip
              New Member
              • Aug 2007
              • 27

              #7
              Hi,

              Let me starts from the beginning. At the index.php file, there are widgets that open to virtual windows.

              I would like to know how to create a function dynamic enough that i can :

              Create a link in a page that once clicked will create the shortcut to it at the desktop.Keeping in mind the previous state of the page has been saved.For example order.html has a save button on it that saves the state of the page and a button that creates a shortcut. or

              Display a shortcut on my desktop that will point to another virtual window.

              Thanks a lot for the help.

              Comment

              • gits
                Recognized Expert Moderator Expert
                • May 2007
                • 5390

                #8
                i'm a little bit confused now ... let me try to understand:

                you have a php-page ... that is delivered to the browser -> you have a html-page there and now the user may perform some actions. here you may store things in a javascript-variable for the lifetime of your page ... that means, when the user leaves your page all js-variable-values are lost otherwise you have to send it back to the server. may be you want to store it that way? so now the user may do something other on your page ... and may be later on he wants to use his former 'order-page' again without filling something again? so we load the orderpage and ask for our stored js-variable-values and fill it with the users former inputs? and the server-turnaround is done when he really wants to submit the page? for ease of use you want to give him a shortcut WITHIN your application to access the things he possibly wants from there?

                kind regards

                Comment

                • bimeldip
                  New Member
                  • Aug 2007
                  • 27

                  #9
                  Hi,
                  Yes i do have a php page that is delivered to the browser.I also have the html page there, where users can perform some functions(i.e. "save")
                  The save function is php driven, so thats not a problem.
                  There is a link on that html page that will generate a shortcut.(here is where i expect the javascript codes to be evoked)

                  Now back to the desktop:
                  Whenever the link on the html page is clicked, it will generate a shortcut icon on the desktop.

                  When clicked on the shortcut (at the desktop) it will open that page.

                  So my logic would be to create a dynamic javascript function that can

                  - be called when we click on the shortcut icon at the desktop to display a virtual window and

                  -be called when we click the link at the html page to produce a shortcut to the html page.

                  Does that sound possible? or is my imagination going on hyperdrive..(=D )..

                  Thanks

                  Comment

                  • gits
                    Recognized Expert Moderator Expert
                    • May 2007
                    • 5390

                    #10
                    hi ... as i said in my first reply ... you cannot create a icon on the users desktop ... you are strictly bound to be WITHIN the browser-window ... and that is good ... nobody wants to have a webspage that is able to do things at your computer outside its own sandbox (which is our browser-window) ...

                    and as i said ... you may create the shortcut for the user within your page so he has to logon to it and you give him a list of links that you want hin to give ... or you may create a bookmark from the link you mentioned ...

                    kind regards

                    Comment

                    • bimeldip
                      New Member
                      • Aug 2007
                      • 27

                      #11
                      how do i create a book mark from the link given?
                      so you are saying if
                      from my index.php file, i click a link and go to orderform.html
                      the html page opens, and in it is a link "create shortcut"
                      i can create a book mark to it..can i tag a long the image to it?

                      Jus trying ways to come around it..=D
                      Thanks...

                      Comment

                      • gits
                        Recognized Expert Moderator Expert
                        • May 2007
                        • 5390

                        #12
                        hi ...

                        may be the following link is of some help to you:

                        Javascript Bookmark Function

                        kind regards

                        Comment

                        Working...