"GET Method"
Bootstrap 3.1.0 Snippet by muhittinbudak

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <body> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Strait"> <div class="container" style="font-family: 'Strait', sans-serif;"> <h2 class="text-center">GET Parametrelerini Okuma</h2> <div class="row"> <div class="col-xs-6 col-md-6 col-sm-6" style="border-right-style:solid;border-width: 1px;"> <strong><input style="border-color:#00575A;" id="alan1" name="alan1" class="form-control input-lg" placeholder="value 1" required=""></strong> </div> <div class="col-xs-6 col-md-6 col-sm-6"> <strong><input style="border-color:#80008A;" id="alan2" name="alan2" class="form-control input-lg" placeholder="value 2"></strong> </div> </div> <hr> <div id="param1" class="param-box bg-primary text-white"></div> <div id="param2" class="param-box bg-success text-white"></div> <div id="param3" class="param-box bg-warning text-white">1</div> <div class="alert alert-info"> Bu sayfayı şu şekilde açmayı deneyin: <code>?name1=Ali&name2=Veli</code> </div> <div id="tikla" class="btn btn-danger btn-lg">GET</div> <small id="sonuc" class="h4 text-mute">aa</small> </div> </body>
body { padding: 30px; font-family: Arial, sans-serif; } .param-box { margin-bottom: 15px; font-size: 20px; padding: 15px; border-radius: 6px; }
$(document).ready(function () { function getParameterByName(name) { const url = window.location.href; const regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"); const results = regex.exec(url); return results ? decodeURIComponent(results[2].replace(/\+/g, " ")) : null; } const name1 = getParameterByName("name1") || "Parametre yok"; const name2 = getParameterByName("name2") || "Parametre yok"; $("#param1").text("name1: " + name1); $("#param2").text("name2: " + name2); const urlm = window.location.href; $("#param3").text(urlm); $("#tikla").on("click", function() { $("#sonuc").text("ok"); }); });

Related: See More


Questions / Comments: