Ajax (Puro)

Este artigo vou falar sobre Ajax com javascript ‘Puro’, sem usar nenhuma library.

primeiro passo: vamos fazer um arquivo .php, por exemplo: ajax.php
com o Codigo Abaixo:

      /**
      *  Quando é feito aquisição 
      *  para o ajax.php com a seguinte URL ajax.php?id="+value
      *  e passado por $_GET o id, aqui abaixo coloquei
      *  um jeito simples de entender se a id for igual á 1 
      *  ele faz o select    
      * */
	 if($_GET['id'] == 1){
	 	echo "";
	 }
	 
	 if($_GET['id'] == 2){
	 	echo "";
	 }
	 
	 if($_GET['id'] == 3){
	 	echo "
	 }
                

Após feito o arquivo ajax.php citado acima iremos fazer o html
nomeando o mesmo de index.html


	

e Finalmente chegamos na parte mais legal Javascript aonde será feito a requisição ajax

function buscaOs(value)
    {		
        if(value != ''){
        	// Instancia o XMLHttpRequest
            var http = new XMLHttpRequest();
        	// Aqui sera passado o Metodo para onde sera direcionado a aquisição
            http.open("GET","ajax.php?id="+value, true);
        	// Cabeçalho
            http.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8");
        	// Estações do Ajax Lembrando que são 4
            http.onreadystatechange = function() {
        		// Primeira Estação Carregando a solicitação
                if(http.readyState == 1){
                	// Gif de Loading
                    document.getElementById('distOs').innerHTML = ''
                }
        		// 4 estação já concluida e o status 200 como tudo OK 404 erro
                if(http.readyState == 4 && http.status == 200) {
                	// tira o none do display CSS
                    document.getElementById('distOs').style.display='block';
                	// Faz um innerHTML para a resposta que veio da requesição ajax.php
                    document.getElementById('distOs').innerHTML = http.responseText;
                }
            }
            http.send(null);
        } else {
        	// Se estiver vazio propriedade css NONE
            document.getElementById('distOs').style.display='none';
        }
    }

Abaixo segue um exemplo do tutorial
Download do Arquivo

Espero que tenham gostado

GOD BLESS YOU

177 thoughts on “Ajax (Puro)

  1. 842894 979243The the next occasion Someone said a weblog, Hopefully so it doesnt disappoint me approximately this. What im saying is, I know it was my choice to read, but I truly thought youd have something fascinating to express. All I hear is often several whining about something which you could fix should you werent too busy looking for attention. 815062

  2. pfnqrz,A fascinating discussion is definitely worth comment. I do think that you ought to publish more on this topic, it may not be a taboo xhzylzdgkao,subject but generally folks don’t talk about such subjects. To the next! All the best!!

  3. xbqjxgszmp,Thanks for ones marvelous posting! I actually enjoyed reading it, you will be a great author.I will always bookmark your blog and will suogntnbrk,come back from now on. I want to encourage that you continue your great writing, have a nice afternoon!

  4. madupbwjcef,Are you searching for top class Escort service in Noida and want to enjoy with them, hire sexy girls from top Greater Noida escort service and enjoy full night.

  5. For Sale Free Shipping Macrobid Cheap Overseas Provera (Modus Medroxyprogesterone) Propecia En Madrid [url=http://cialtadalaf.com]cialis without a doctor’s prescription[/url] Amoxicillin And Atenolol

  6. At the time of the heat, the money was invested in the stock market. That experience made the 69-year-old Dario finally become a global macro investor, and used this to shape the understanding of the economy and the market. Dalio believes that capitalism is the most effective mechanism for resource allocation in terms of raising living standards. But to this day, the capitalist system has little or no actual income growth for most people.

  7. Last year, the Giants passed on QBs Sam Darnold, Josh Rosen and Josh Allen and drafted a running back second overall. Even with Saquon Barkley’s Offensive Rookie of the Year performance, New York won only five games with eroding statue Eli Manning behind center, and that appears to be the plan yet again. Daniel Jones played under David Cutcliffe at Duke, and there’s no doubt Cutcliffe’s cozy relationship with the Manning family had plenty to do with the Giants selecting Jones with the No. 6 pick.

  8. “Everything’s always on the table,” Kerr said. “Every playoff game, everything is always on the table. We consider everything. We go over every possibility. We hash it out. We ask the players their opinions on stuff and we make adjustments.

  9. You can definitely see your expertise in the work you write.
    The world hopes for even more passionate writers such as you who are not afraid to
    mention how they believe. At all times follow your heart.

  10. Hey there! I just wanted to ask if you ever have any trouble with hackers?
    My last blog (wordpress) was hacked and I ended up losing
    months of hard work due to no back up. Do you have any methods to protect against hackers?

  11. After I initially left a comment I appear to have clicked on the -Notify me when new comments are
    added- checkbox and from now on whenever a comment is added I recieve four
    emails with the same comment. There has to be a way you can remove me from that service?
    Thanks a lot!

  12. Pretty nice post. I simply stumbled upon your blog and wanted to say that I’ve really enjoyed surfing around your weblog
    posts. After all I’ll be subscribing for your feed and I hope you write again soon!

  13. Hi would you mind stating which blog platform you’re using?

    I’m planning to start my own blog soon but I’m having a tough time
    deciding between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design seems different then most blogs and I’m looking for something completely
    unique. P.S My apologies for being off-topic
    but I had to ask!

  14. Right now it seems like Drupal is the preferred blogging platform available right now.
    (from what I’ve read) Is that what you are using
    on your blog?

  15. I needed to thank you for this good read!! I absolutely loved every bit of it.
    I’ve got you saved as a favorite to check out new things you post…

  16. I have been browsing online more than 3 hours today, yet I never found any interesting
    article like yours. It is pretty worth enough for me. Personally,
    if all web owners and bloggers made good content as you did, the internet will be a lot more useful than ever before.

  17. Thanks for every other informative blog. Where else could I
    get that type of information written in such a perfect means?
    I’ve a undertaking that I’m simply now operating on, and I have
    been on the glance out for such info.

  18. This is the right blog for everyone who hopes to find out about this topic.

    You realize so much its almost tough to argue with you (not
    that I really would want to…HaHa). You certainly put a new spin on a subject that’s been written about for decades.
    Wonderful stuff, just excellent!

  19. [url=https://propecia5mg.com/]propecia[/url] [url=https://sildenafilcitrate50.com/]sildenafil citrate 100 mg[/url] [url=https://tadalafil100.com/]tadalafil for women[/url] [url=https://atarax25.com/]atarax tablets[/url] [url=https://cialis50.com/]daily cialis cost[/url] [url=https://tetracyclinerx.com/]buy tetracycline online[/url] [url=https://lisinoprilmed.com/]drug lisinopril[/url] [url=https://furosemide80.com/]furosemide 40 mg tablets[/url] [url=https://cafergotbuy.com/]cafergot online[/url] [url=https://acyclovir200.com/]acyclovir 200[/url] [url=https://vardenafil40.com/]vardenafil hcl[/url] [url=https://ventolinhf.com/]proventil hfa 90 mcg inhaler[/url] [url=https://tadalafilus.com/]online tadalafil[/url] [url=https://acyclovirc.com/]buy acyclovir[/url] [url=https://tadalafilpro.com/]tadalafil[/url] [url=https://prednisolone1.com/]prednisolone[/url] [url=https://cialis60.com/]cialis 60[/url] [url=https://allopurinol300.com/]allopurinol[/url] [url=https://advair250.com/]advair[/url] [url=https://propranolol80.com/]propranolol[/url]

  20. [url=http://cialis50.com/]order cialis by phone[/url] [url=http://amoxicillin250.com/]amoxicillin 250[/url] [url=http://tadalafilus.com/]buy tadalafil online[/url] [url=http://prednisone40.com/]prednisone[/url] [url=http://tetracyclinerx.com/]buy tetracycline online[/url]

  21. Heya this is kind of of off topic but I was wanting to know if blogs use WYSIWYG editors or
    if you have to manually code with HTML. I’m starting a blog
    soon but have no coding skills so I wanted to get advice from
    someone with experience. Any help would be greatly appreciated!

  22. My partner and I stumbled over here by a different website and thought I may as well check
    things out. I like what I see so now i am following you.
    Look forward to looking over your web page yet again.

  23. Hello, I do think your web site may be having browser compatibility problems.
    When I look at your blog in Safari, it looks fine however when opening
    in Internet Explorer, it has some overlapping issues.
    I merely wanted to give you a quick heads up!
    Besides that, great site!

  24. [url=https://cialis60.com/]cialis 60[/url] [url=https://acyclovir200.com/]acyclovir[/url] [url=https://allopurinol300.com/]allopurinol 100mg tablets[/url] [url=https://albuteroli.com/]albuterol[/url] [url=https://acyclovirc.com/]acyclovir without prescription[/url] [url=https://propranolol80.com/]propranolol 10mg cheap[/url] [url=https://ventolinsale.com/]ventolin online[/url] [url=https://vardenafil40.com/]vardenafil[/url] [url=https://ventolinhf.com/]ventolin hfa[/url] [url=https://dapoxetineusa.com/]dapoxetine 60 mg[/url]

  25. Thanks for your personal marvelous posting! I quite enjoyed reading it, you are a great author.I will always bookmark
    your blog and will often come back someday. I want to encourage that
    you continue your great work, have a nice evening!

  26. Somebody necessarily help to make severely articles I would
    state. That is the first time I frequented your website page and up to now?
    I amazed with the analysis you made to create this
    particular submit incredible. Great process!

  27. Hello there I am so delighted I found your weblog, I really found you by mistake,
    while I was browsing on Askjeeve for something else, Regardless I
    am here now and would just like to say kudos for a fantastic
    post and a all round enjoyable blog (I also love the theme/design), I
    don’t have time to read through it all at the minute but I
    have book-marked it and also included your RSS feeds,
    so when I have time I will be back to read a lot more,
    Please do keep up the excellent job.

  28. Hey there just wanted to give you a brief heads up and let you know a few of the pictures
    aren’t loading correctly. I’m not sure why but I think its a linking
    issue. I’ve tried it in two different web browsers and both show the same outcome.

  29. I’m no longer sure the place you’re getting your info, however
    great topic. I must spend some time learning much more or understanding more.
    Thanks for wonderful info I was on the lookout for this information for my mission.

  30. Hello just wanted to give you a quick heads up and let you know a few
    of the pictures aren’t loading correctly. I’m not sure why but I think its a linking issue.
    I’ve tried it in two different browsers and both show the same results.

  31. My brother suggested I might like this web
    site. He was totally right. This put up actually made my day.
    You can not imagine just how a lot time I had spent for this information! Thank you!

  32. I absolutely love your blog and find almost all of your post’s to be just what I’m looking for.
    Would you offer guest writers to write content for yourself?
    I wouldn’t mind writing a post or elaborating on a few of the
    subjects you write concerning here. Again, awesome weblog!

  33. Y P Healthcare Viagra Generic With Out Prescription Propecia Galenica [url=http://exdrugs.com]viagra[/url] Tadacip 20 India Amoxicillin For Oral Suspension Expire

  34. Hi, i believe that i noticed you visited my site thus i came to return the
    favor?.I’m attempting to in finding issues to improve my
    site!I suppose its ok to use a few of your concepts!!

  35. You are so interesting! I don’t suppose I have read through a single thing like this before.
    So good to find another person with a few unique thoughts on this subject matter.
    Really.. thank you for starting this up. This site is something that’s needed on the
    web, someone with a little originality!

  36. Hello, I think your blog might be having browser
    compatibility issues. When I look at your website
    in Opera, it looks fine but when opening in Internet Explorer,
    it has some overlapping. I just wanted to give you a quick heads up!

    Other then that, awesome blog!

  37. Hey there! I know this is somewhat off topic but I was wondering which blog platform
    are you using for this website? I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking at options for another platform.
    I would be great if you could point me in the direction of a
    good platform.

  38. Hey there! I’ve been reading your weblog for a long time now
    and finally got the bravery to go ahead and give you a shout out from Austin Texas!
    Just wanted to tell you keep up the good job!

  39. Where Can I Buy Effexor Xr Acheter Viagra Generique En France [url=http://ciali10mg.com]tadalafil cialis from india[/url] Amoxicillin Dairy Milk Where Sells Genuine Clomid In The Uk Priority Mail 2 Day Delivery On Cialis

  40. Hey there! I’ve been reading your weblog for a while now and finally got the courage to go ahead and give you a shout out from Houston Texas!
    Just wanted to tell you keep up the fantastic work!

  41. I have been surfing online more than three hours
    these days, yet I by no means found any fascinating article like
    yours. It’s lovely worth enough for me. Personally, if all site owners
    and bloggers made excellent content material as you probably did, the net
    might be much more helpful than ever before.

  42. With havin so much written content do you ever run into any
    issues of plagorism or copyright infringement?
    My blog has a lot of exclusive content I’ve either written myself
    or outsourced but it looks like a lot of it is popping it
    up all over the web without my authorization. Do you know any
    solutions to help stop content from being stolen? I’d certainly appreciate it.

  43. With havin so much content and articles do you ever run into any issues of plagorism or copyright violation? My
    blog has a lot of exclusive content I’ve either authored
    myself or outsourced but it appears a lot of it is popping it up all over the
    internet without my authorization. Do you know any solutions to help
    stop content from being ripped off? I’d genuinely appreciate it.

  44. You’ve made some good points there. I looked on the web for more info about the issue and found most people will
    go along with your views on this web site.

  45. Clobetasol Medicine Internet No Doctor Cialis Uso Diario Tamoxifene [url=http://asacdz.com]cialis prices[/url] Amoxicillin And Prenatal Vitamin Levitra Informazioni Is Outdated Amoxicillin Safe

  46. With havin so much content and articles do you
    ever run into any problems of plagorism or copyright infringement?

    My site has a lot of exclusive content I’ve either created myself or outsourced
    but it looks like a lot of it is popping it up all over the internet without my authorization. Do
    you know any techniques to help stop content from being ripped off?
    I’d definitely appreciate it.

  47. Excellent post. I was checking continuously this
    blog and I’m impressed! Very helpful information specifically the last part
    🙂 I care for such info much. I was looking for this particular information for
    a long time. Thank you and best of luck.

  48. Pingback: Google
  49. What i don’t understood is in reality how you’re now not really a lot more well-liked than you might be now. You are so intelligent. You recognize therefore significantly in terms of this topic, made me for my part imagine it from so many numerous angles. Its like men and women are not interested until it’s one thing to do with Girl gaga! Your personal stuffs excellent. At all times maintain it up!

  50. I’m not sure where you’re getting your information, but good topic.

    I must spend some time learning much more or working out more.

    Thank you for magnificent info I used to be in search of this information for my mission.

  51. [url=http://cipro4you.us.com/]Cipro[/url] [url=http://traitsjs.org/]indocin online[/url] [url=http://retin-a365.us.org/]retin a[/url] [url=http://retina.run/]cheap retin-a[/url] [url=http://tadalafil365.us.com/]tadalafil[/url] [url=http://celebrex.recipes/]celebrex[/url]

  52. [url=https://wellbutrin300.com/]wellbutrin bupropion[/url] [url=https://generictadalafil20mg.com/]tadalafil 20mg[/url] [url=https://vardenafilbuy.com/]vardenafil buy[/url] [url=https://hydrochlorothiazide25.com/]hydrochlorothiazide 12.5 mg cp[/url] [url=https://cafergot100.com/]cafergot[/url] [url=https://lisinoprilbuy.com/]lisinopril for sale[/url] [url=https://zoviraxacyclovir.com/]buy zovirax[/url] [url=https://atenolol25.com/]atenolol 25 mg[/url] [url=https://azithromycin100.com/]azithromycin z-pak[/url] [url=https://allopurinolzyloprim.com/]allopurinol[/url]

  53. Pingback: best sex toys
  54. [url=https://sildalis120.com/]generic sildalis[/url] [url=https://lisinoprilbuy.com/]lisinopril[/url] [url=https://azithromycin100.com/]azithromycin buy online[/url] [url=https://allopurinolzyloprim.com/]buy cheap allopurinol[/url] [url=https://buydiflucan.com/]buy diflucan over the counter[/url] [url=https://vardenafilbuy.com/]vardenafil buy[/url] [url=https://femaleviagra24.com/]viagra for females[/url] [url=https://generictadalafil20mg.com/]tadalafil 20mg[/url] [url=https://atarax10.com/]atarax 50 mg[/url] [url=https://hydrochlorothiazide25.com/]hydrochlorothiazide 25 mg tab[/url]

  55. [url=https://tetracycline365.com/]buy tetracycline online[/url] [url=https://doxycycline02.com/]doxycycline[/url] [url=https://atarax10.com/]atarax generic[/url] [url=https://sildenafil1000.com/]buy sildenafil online[/url] [url=https://sildalis120.com/]sildalis[/url]

  56. [url=https://generictadalafil20mg.com/]buy tadalafil online[/url] [url=https://tetracycline365.com/]tetracycline antibiotics[/url] [url=https://buydiflucan.com/]buy diflucan[/url] [url=https://doxycycline02.com/]doxycycline 100mg[/url] [url=https://vardenafilbuy.com/]vardenafil buy online[/url] [url=https://atarax10.com/]atarax 50 mg[/url] [url=https://cafergot100.com/]cafergot online[/url]

  57. [url=https://doxycycline02.com/]buy doxycycline[/url] [url=https://buydiflucan.com/]buy diflucan[/url] [url=https://cafergot100.com/]cheap cafergot[/url] [url=https://wellbutrin300.com/]generic for wellbutrin xl[/url] [url=https://femaleviagra24.com/]buy female viagra online[/url] [url=https://generictadalafil20mg.com/]tadalafil 20 mg[/url] [url=https://zoviraxacyclovir.com/]buy acyclovir[/url]

  58. [url=https://lisinoprilbuy.com/]lisinopril 20 mg no prescription[/url] [url=https://levitrasale.com/]levitra 20 mg cost[/url] [url=https://atarax10.com/]atarax generic[/url] [url=https://zoviraxacyclovir.com/]acyclovir[/url] [url=https://sildalis120.com/]sildalis online[/url] [url=https://wellbutrin300.com/]wellbutrin xl 300mg[/url] [url=https://hydrochlorothiazide25.com/]hydrochlorothiazide triamterene[/url] [url=https://vardenafilbuy.com/]vardenafil price[/url] [url=https://tetracycline365.com/]tetracycline online[/url] [url=https://xenical120mg.com/]buy xenical[/url]

  59. Cialis Farmaco Generico Achat Propecia [url=http://buyoxys.com]vardenafil in osterreich erhaltlich[/url] Achat Viagra En Tunisie Vente De Cialis En Ligne Viagra Opinione

  60. Pingback: go
  61. The very heart of your writing while appearing reasonable initially, did not really settle perfectly with me after some time. Somewhere within the sentences you actually were able to make me a believer unfortunately only for a short while. I still have got a problem with your leaps in assumptions and one might do well to fill in all those breaks. When you actually can accomplish that, I will surely end up being impressed.

  62. Pingback: Hotmail Sign In
  63. [url=http://lender.us.org/]payday lender[/url] [url=http://moneyfast.us.org/]credit loan application[/url] [url=http://badcredit.us.org/]need payday loan[/url] [url=http://paydayloansonline.us.com/]personal loans with low interest rates[/url] [url=http://simpleloan.us.org/]loans online instant approval[/url]

  64. [url=https://moneyfast.us.org/]money quick[/url] [url=https://simpleloan.us.org/]easy payday[/url] [url=https://lending.us.org/]payday lending[/url] [url=https://paydayloansonline.us.com/]online payday loans[/url] [url=https://badcredit.us.org/]bad credit loans[/url]

  65. Do you mind if I quote a few of your articles as long as I provide credit and sources back to
    your webpage? My blog site is in the exact same area of interest as yours and my visitors
    would truly benefit from a lot of the information you present here.
    Please let me know if this alright with you. Thanks a
    lot!

  66. Pingback: viagra
  67. Thanks for some other wonderful article. The place else could anybody get that
    kind of info in such an ideal approach of writing? I have a presentation next week,
    and I’m at the search for such info.

  68. Pingback: jockstrap bulge
  69. [url=http://buydiflucan.com/]buy diflucan[/url] [url=http://azithromycin100.com/]cost of azithromycin[/url] [url=http://vardenafilbuy.com/]vardenafil 40mg[/url] [url=http://levitrasale.com/]levitra[/url] [url=http://hydrochlorothiazide25.com/]hydrochlorothiazide 125mg[/url] [url=http://lisinoprilbuy.com/]lisinopril[/url]

  70. Pingback: cock ring
  71. [url=https://tetracycline365.com/]antibiotic tetracycline[/url] [url=https://xenical120mg.com/]xenical 120[/url] [url=https://doxycycline02.com/]doxycycline online[/url] [url=https://cafergot100.com/]cafergot tablets[/url] [url=https://sildenafil1000.com/]sildenafil citrate online[/url] [url=https://hydrochlorothiazide25.com/]hydrochlorothiazide 25[/url] [url=https://azithromycin100.com/]azithromycin 500[/url] [url=https://buydiflucan.com/]buy diflucan[/url] [url=https://vardenafilbuy.com/]vardenafil buy[/url] [url=https://femaleviagra24.com/]female viagra[/url] [url=https://sildalis120.com/]sildalis buy[/url] [url=https://atarax10.com/]buy atarax online[/url] [url=https://atenolol25.com/]atenolol 100 mg[/url] [url=https://levitrasale.com/]levitra 20 mg cost[/url] [url=https://allopurinolzyloprim.com/]allopurinol buy no prescription[/url]

  72. Pingback: iraniporn
  73. Pingback: Yt Mp3
  74. Howdy! I understand this is sort of off-topic but I needed to ask.

    Does managing a well-established website such as yours require a large amount
    of work? I’m completely new to writing a blog however I do
    write in my journal every day. I’d like to start a blog so I can share my experience and views online.
    Please let me know if you have any kind of recommendations or
    tips for new aspiring blog owners. Appreciate it!

  75. [url=https://xenical120mg.com/]xenical[/url] [url=https://generictadalafil20mg.com/]generic tadalafil[/url] [url=https://doxycycline02.com/]doxycycline 100mg[/url] [url=https://vardenafilbuy.com/]vardenafil hydrochloride[/url] [url=https://sildenafil1000.com/]sildenafil over the counter[/url] [url=https://atenolol25.com/]atenolol 50mg[/url] [url=https://buydiflucan.com/]buy diflucan without prescription[/url] [url=https://allopurinolzyloprim.com/]allopurinol[/url] [url=https://sildalis120.com/]generic sildalis[/url] [url=https://azithromycin100.com/]azithromycin buy online[/url]

  76. [url=https://loansonline2019.com/]loans online instant approval[/url] [url=https://cashadvance3.com/]loans 2019[/url] [url=https://paydayloans3.com/]payday loans[/url] [url=https://personalloans2.com/]personal loan[/url] [url=https://loansforbadcredit1.com/]loans for bad credit[/url]

  77. Pingback: websites
  78. Pingback: laminate flooring
  79. [url=https://valtrexxl.com/]buy valtrex[/url] [url=https://clomid100.com/]clomid[/url] [url=https://cephalexin250.com/]cephalexin[/url] [url=https://arimidex10.com/]arimidex buy[/url] [url=https://viagrasf.com/]buy viagra soft tabs[/url] [url=https://cialis0.com/]cialis 5 mg best price[/url] [url=https://tadacipl.com/]tadacip 20 mg[/url] [url=https://strattera10.com/]straterra[/url] [url=https://tadalafil911.com/]tadalafil 20mg best price[/url] [url=https://albuteroll.com/]albuterol inhaler cost[/url] [url=https://zithromaxz.com/]zithromax antibiotic[/url] [url=https://lisinopril125.com/]lisinopril[/url] [url=https://colchicineiv.com/]colchicine buy[/url] [url=https://tadalafil19.com/]tadalafil[/url] [url=https://stromectol1.com/]buy stromectol[/url] [url=https://cipromd.com/]cipro 500mg dosage[/url] [url=https://levitra1.com/]levitra[/url] [url=https://acyclovirz.com/]acyclovir 800[/url] [url=https://motilium1.com/]motilium[/url] [url=https://synthroidp.com/]synthroid[/url]

Deixe uma resposta

O seu endereço de e-mail não será publicado.