Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Block thread

Block thread

Scheduled Pinned Locked Moved JavaScript
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Leng Vang
    wrote on last edited by
    #1

    Has anyone come up with a way to temporary halt execution of current thread like the build in "alert" and "prompt" functions. We know the ugliness of those built-in functions, I want to create my own, but I have to implement callback, nature of asynchronous. Its natural to just do: var msg = myprompt("title","message",default);

    Z 1 Reply Last reply
    0
    • L Leng Vang

      Has anyone come up with a way to temporary halt execution of current thread like the build in "alert" and "prompt" functions. We know the ugliness of those built-in functions, I want to create my own, but I have to implement callback, nature of asynchronous. Its natural to just do: var msg = myprompt("title","message",default);

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      If you are doing an async call are you using jQuery.ajax()? If so, you can set async to false.

      There are only 10 types of people in the world, those who understand binary and those who don't.

      L 1 Reply Last reply
      0
      • Z ZurdoDev

        If you are doing an async call are you using jQuery.ajax()? If so, you can set async to false.

        There are only 10 types of people in the world, those who understand binary and those who don't.

        L Offline
        L Offline
        Leng Vang
        wrote on last edited by
        #3

        Thanks for the reply. Yes, asyn is the only way I know how. I'm trying to do it with straight JavaScript, but perhaps I should expand to include jQuery library. Or may be I should look under the hood how jQuery does it. Good direction pointing.

        Z 1 Reply Last reply
        0
        • L Leng Vang

          Thanks for the reply. Yes, asyn is the only way I know how. I'm trying to do it with straight JavaScript, but perhaps I should expand to include jQuery library. Or may be I should look under the hood how jQuery does it. Good direction pointing.

          Z Offline
          Z Offline
          ZurdoDev
          wrote on last edited by
          #4

          That's true. Setting async to false does cause it to wait but you're right, I'm not sure how it is actually doing that.

          There are only 10 types of people in the world, those who understand binary and those who don't.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups