jquery

MVC3 - Update jQuery from 1.5.2 to latest

南楼画角 提交于 2021-01-27 23:01:17
问题 I have a MVC3 project that uses jQuery 1.5.2 and I would like to update to the latest version. I am a bit new to MVC3 and I am wondering about the consequences of updating jQuery? Does anybody have any experience whit this? And how can it be achieved? Best regards Dep. 回答1: In general There are big changes in the jQuery 1.9.x compared to the previous versions. You can check those changes from here. jQuery team did great work and created jQuery Migrate plugin. The idea is that you change your

How to send form containing files via jQuery ajax using PATCH method to Laravel 5?

旧街凉风 提交于 2021-01-27 22:51:50
问题 This is my code: //routes.php Route::match(['post', 'patch'],'/slide/{id}', function() { dd(request()->all()); }); //form <form id="form" enctype="multipart/form-data"> <input type="text" name="title"> <input type="file" name="image"> </form> //js $('#form').on('submit',(function(e) { $.ajax({ type: "PATCH", url:'/slide/' + id, data: new FormData(this), cache: false, contentType: false, processData: false }).done(function(r) { console.log(r); }); })); When I use POST method everything is fine

Send email from contact form in Laravel 5 using jQuery AJAX

橙三吉。 提交于 2021-01-27 22:50:24
问题 I have contact form in Laravel blade: <div id="contactform"> <meta name="_token" content="{{ csrf_token() }}" /> <ul> @foreach($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> {{ Form::open(array('route' => 'contact_store', 'id' => 'contact', 'name' => 'contact')) }} <input type="text" id="firstName" name="firstName" placeholder="{{ trans('index.first_name') }}" class="required" /> <input type="text" id="lastName" name="lastName" placeholder="{{ trans('index.last_name') }}"

Transform doesnt animate when added class with transform: scale(1) via Jquery

天涯浪子 提交于 2021-01-27 22:43:50
问题 I am trying to insert a new div with fancy transform: scale() animation when button is clicked, however it doesn't animate. I am not sure why. Any suggestions? Thanks. $("button").click(event => { let div = $("<div></div>"); div.insertAfter("button"); div.addClass("animate"); }); div{ height: 50px; width: 50px; background: #000; transform: scale(0); transition: transform 1s; } .animate{ transform: scale(1); } <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> <button>Button<

Ajax success function not receive data

倾然丶 夕夏残阳落幕 提交于 2021-01-27 22:25:52
问题 Below is webmethod of my web form which is returning a List of data and it works fine: [WebMethod] public static List<SalesInvoiceFinalCalculationEntity> salesInvoiceFinalCalculaiton(string InvoiceNo) { List<SalesInvoiceFinalCalculationEntity> list = new List<SalesInvoiceFinalCalculationEntity>(); list = SalesInvoiceManager1.salesInvoiceFinalCalculaiton(InvoiceNo); return list; } But in below Ajax function, I can't retrieve the data. When I bind data to textbox in ajax success function, it

How to align div elements?

别说谁变了你拦得住时间么 提交于 2021-01-27 21:50:41
问题 I am trying to make a jsp page on product details. I'm a bit new to CSS so I am unable to align the div elements side by side. .nav { float: right; } * { margin: 0; padding: 0; } body { background-color: #F2EEE9; font: normal 13px/1.5 Georgia, Serif; color: #333; } .item { background-color: #fff; position: relative; margin: 30px auto 30px auto; width: 978px; } .item img { display: block; margin: auto; } <div class="item"> <div style="background: url(http://placehold.it/370x330); height: 370px

echo json_encode() not working via ajax call

旧城冷巷雨未停 提交于 2021-01-27 21:36:43
问题 I really don't know what i'm missing here. I have this script: <script type="text/javascript"> function ServiceOffer(){ var service_name = $('#service_name').val(), dataString = "service=" + service_name; $.ajax({ type: "POST", url: "posted.php", data:dataString, success:function(data){ console.log(data); } }); } $(document).ready(function(){ ServiceOffer(); $(document).on('change','#service_name',function(){ ServiceOffer(); }); }); </script> And here is my code for posted.php <?php $connect

Input field wont function (Can't type text in it)

大憨熊 提交于 2021-01-27 21:17:50
问题 I have a search box which slides out when you click on a div but it wont let me put any text in and I can't find a reason why. $('#searchh').click(function() { $('.search-button').animate({ 'left': '520px' }); }); $('#searchh').click(function() { $('.search-balk').animate({ 'width': '295px' }); }); .search-button { position: absolute; left: 225px; margin-top: -30px; z-index: -1; -webkit-transition: background-position 0.8s, color 1s; -moz-transition: background-position 0.8s, color 1s;

Animate a div when we scroll to a specific position

大憨熊 提交于 2021-01-27 21:11:16
问题 I have a function that decrease the width of the slider-side-hr to 0 when scrolling from the top of the page to -600 of the scrolling div height (which means before reaching the bottom of the scrolling div ). The slider sides are both fixed, one to right and the other to the left. <div class="tower" id="tower2"> <div class="scroll-slider-hr"> <div class="slider-side-hr slider-side1"></div> <div class="slider-side-hr slider-side2"></div> </div> </div> It works perfectly fine and the width of

html keep language in bilingual site

心已入冬 提交于 2021-01-27 21:04:01
问题 I'm working on a bilingual site (spanish/english), I took the advice from the 2nd answer in this post. This is the bit of code in the navbar that I use to pick a language: <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" id="dropdown06" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span lang="es">Idioma</span> <span lang="en">Language</span> </a> <div class="dropdown-menu" aria-labelledby="dropdown06"> <a class="dropdown-item coll-navbar language">