<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AJAX Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/category/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/category/ajax/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Mon, 19 Jun 2023 13:29:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Top 50 Ajax Interview Questions with Answers</title>
		<link>https://www.scmgalaxy.com/tutorials/top-50-ajax-interview-questions-with-answers/</link>
					<comments>https://www.scmgalaxy.com/tutorials/top-50-ajax-interview-questions-with-answers/#respond</comments>
		
		<dc:creator><![CDATA[Ashwani Kumar]]></dc:creator>
		<pubDate>Mon, 01 May 2023 08:38:36 +0000</pubDate>
				<category><![CDATA[AJAX]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=10117</guid>

					<description><![CDATA[<p>1. What is AJAX? A. A programming languageB. A web development techniqueC. A database management system Answer: B 2. What [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/top-50-ajax-interview-questions-with-answers/">Top 50 Ajax Interview Questions with Answers</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img fetchpriority="high" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2023/05/image-8.png" alt="" class="wp-image-10118" width="659" height="365" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2023/05/image-8.png 900w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2023/05/image-8-300x167.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2023/05/image-8-768x427.png 768w" sizes="(max-width: 659px) 100vw, 659px" /><figcaption class="wp-element-caption"><strong><em>Ajax Interview Questions with Answers</em></strong></figcaption></figure>
</div>


<h3 class="wp-block-heading">1. What is AJAX?</h3>



<p class="wp-block-paragraph">A. A programming language<br>B. A web development technique<br>C. A database management system</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">2. What is the full form of AJAX?</h3>



<p class="wp-block-paragraph">A. Asynchronous JavaScript and XML<br>B. Asynchronous JavaScript and XHTML<br>C. Asynchronous JavaScript and JSON</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">3. What is the main advantage of using AJAX?</h3>



<p class="wp-block-paragraph">A. Improved page load time<br>B. Improved database performance<br>C. Improved server response time</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">4. Which HTTP request method is used in AJAX?</h3>



<p class="wp-block-paragraph">A. GET<br>B. POST<br>C. Both A and B</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">5. Which object is used to create an AJAX request?</h3>



<p class="wp-block-paragraph">A. XMLHttpRequest<br>B. JSONRequest<br>C. AjaxRequest</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">6. What is the role of JSON in AJAX?</h3>



<p class="wp-block-paragraph">A. To store data<br>B. To retrieve data<br>C. To exchange data</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">7. Which function is used to send an AJAX request?</h3>



<p class="wp-block-paragraph">A. xhr.send()<br>B. xhr.open()<br>C. xhr.onload()</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">8. Which function is used to handle AJAX response?</h3>



<p class="wp-block-paragraph">A. xhr.onload()<br>B. xhr.open()<br>C. xhr.send()</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">9. Which HTML tag is used to create an AJAX application?</h3>



<p class="wp-block-paragraph">A.<br>B.<br>C.</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">10. Which file is used to handle AJAX requests in PHP?</h3>



<p class="wp-block-paragraph">A. ajax.php<br>B. ajax_handler.php<br>C. any PHP file can handle AJAX requests</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">11. Which function is used to encode a JavaScript object into JSON format?</h3>



<p class="wp-block-paragraph">A. JSON.format()<br>B. JSON.encode()<br>C. JSON.stringify()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">12. Which function is used to decode a JSON string into a JavaScript object?</h3>



<p class="wp-block-paragraph">A. JSON.parse()<br>B. JSON.decode()<br>C. JSON.object()</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">13. Which method is used to append data to a form before submitting it using AJAX?</h3>



<p class="wp-block-paragraph">A. xhr.append()<br>B. xhr.send()<br>C. FormData.append()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">14. How can you handle errors in AJAX requests?</h3>



<p class="wp-block-paragraph">A. Using try-catch block<br>B. Using xhr.onerror()<br>C. Both A and B</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">15. Which web development framework has built-in support for AJAX?</h3>



<p class="wp-block-paragraph">A. React<br>B. AngularJS<br>C. jQuery</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">16. What is the purpose of the XMLHttpRequest.readyState property in AJAX?</h3>



<p class="wp-block-paragraph">A. To indicate the status of the AJAX request<br>B. To handle AJAX response<br>C. To create an AJAX request</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">17. Which HTTP status code indicates a successful AJAX request?</h3>



<p class="wp-block-paragraph">A. 200<br>B. 400<br>C. 500</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">18. Which method is used to cancel an AJAX request?</h3>



<p class="wp-block-paragraph">A. xhr.cancel()<br>B. xhr.abort()<br>C. xhr.stop()</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">19. Which method is used to set a timeout for an AJAX request?</h3>



<p class="wp-block-paragraph">A. xhr.timeout()<br>B. xhr.setOnTimeout()<br>C. xhr.ontimeout()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">20. Which method is used to disable caching for an AJAX request?</h3>



<p class="wp-block-paragraph">A. xhr.disableCache()<br>B. xhr.setRequestHeader()<br>C. xhr.cache(false)</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">21. What is the syntax for creating an AJAX request using jQuery?</h3>



<p class="wp-block-paragraph">A. $.ajax(url, options)<br>B. $.getJSON(url, data)<br>C. $.post(url, data)</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">22. Which method is used to set the data type of an AJAX response in jQuery?</h3>



<p class="wp-block-paragraph">A. dataType()<br>B. responseType()<br>C. contentType()</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">23. Which property is used to access the response data in an AJAX request using jQuery?</h3>



<p class="wp-block-paragraph">A. data<br>B. responseText<br>C. responseJSON</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">24. Which method is used to serialize a form data in jQuery?</h3>



<p class="wp-block-paragraph">A. serializeForm()<br>B. serializeObject()<br>C. serialize()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">25. Which method is used to submit a form using AJAX in jQuery?</h3>



<p class="wp-block-paragraph">A. ajax()<br>B. submit()<br>C. post()</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">26. What is the syntax for creating an AJAX request using React?</h3>



<p class="wp-block-paragraph">A. fetch(url, options)<br>B. axios(url, options)<br>C. XMLHttpRequest(url, options)</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">27. Which method is used to handle errors in an AJAX request using React?</h3>



<p class="wp-block-paragraph">A. onError()<br>B. onFailure()<br>C. catch()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">28. What is the purpose of the withCredentials property in AJAX requests?</h3>



<p class="wp-block-paragraph">A. To enable cookies in cross-domain requests<br>B. To set the credentials for authentication<br>C. To enable HTTPS requests</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">29. Which method is used to enable cross-domain requests in AJAX?</h3>



<p class="wp-block-paragraph">A. xhr.enableCORS()<br>B. xhr.crossDomain()<br>C. xhr.setRequestHeader()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">30. What is the syntax for creating an AJAX request using AngularJS?</h3>



<p class="wp-block-paragraph">A. $http.get(url, options)<br>B. $ajax(url, options)<br>C. $xhr(url, options)</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">31. Which method is used to handle an error in an AJAX request using AngularJS?</h3>



<p class="wp-block-paragraph">A. error()<br>B. catch()<br>C. failure()</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">32. What is the purpose of the transformRequest function in AngularJS AJAX requests?</h3>



<p class="wp-block-paragraph">A. To transform the request data before sending<br>B. To transform the response data after receiving<br>C. To transform the HTTP headers</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">33. What is the purpose of the transformResponse function in AngularJS AJAX requests?</h3>



<p class="wp-block-paragraph">A. To transform the request data before sending<br>B. To transform the response data after receiving<br>C. To transform the HTTP headers</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">34. Which method is used to cancel an AJAX request in AngularJS?</h3>



<p class="wp-block-paragraph">A. $cancel()<br>B. $abort()<br>C. $http.abort()</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">35. What is the syntax for creating an AJAX request using Vue.js?</h3>



<p class="wp-block-paragraph">A. axios(url, options)<br>B. $xhr(url, options)<br>C. fetch(url, options)</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">36. Which method is used to handle an error in an AJAX request using Vue.js?</h3>



<p class="wp-block-paragraph">A. onError()<br>B. onFailure()<br>C. catch()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">37. What is the purpose of the beforeRequest hook in Vue.js AJAX requests?</h3>



<p class="wp-block-paragraph">A. To modify the request before sending<br>B. To modify the response after receiving<br>C. To modify the HTTP headers</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">38. What is the purpose of the afterResponse hook in Vue.js AJAX requests?</h3>



<p class="wp-block-paragraph">A. To modify the request before sending<br>B. To modify the response after receiving<br>C. To modify the HTTP headers</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">39. Which method is used to cancel an AJAX request in Vue.js?</h3>



<p class="wp-block-paragraph">A. $cancel()<br>B. $abort()<br>C. axios.cancel()</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">40. Which HTTP headers are used to enable caching in AJAX requests?</h3>



<p class="wp-block-paragraph">A. Cache-Control and Expires<br>B. Last-Modified and ETag<br>C. Both A and B</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">41. What is the purpose of ETag header in HTTP responses?</h3>



<p class="wp-block-paragraph">A. To store cached data<br>B. To enable caching for dynamic content<br>C. To validate cached data</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">42. What is the difference between synchronous and asynchronous AJAX requests?</h3>



<p class="wp-block-paragraph">A. Synchronous requests are faster than asynchronous requests<br>B. Asynchronous requests do not block the UI thread<br>C. Synchronous requests do not require a callback function</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">43. What is the purpose of CORS in AJAX requests?</h3>



<p class="wp-block-paragraph">A. To enable cross-domain requests<br>B. To disable cross-domain requests<br>C. To validate cross-domain requests</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">44. Which web security vulnerability is associated with AJAX?</h3>



<p class="wp-block-paragraph">A. Cross-site scripting (XSS)<br>B. Cross-site request forgery (CSRF)<br>C. SQL injection</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">45. What is the purpose of using a nonce in AJAX requests?</h3>



<p class="wp-block-paragraph">A. To prevent CSRF attacks<br>B. To enable caching<br>C. To improve server performance</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">46. Which method is used to encrypt AJAX requests over HTTPS?</h3>



<p class="wp-block-paragraph">A. xhr.encrypt()<br>B. xhr.setSSL()<br>C. xhr.setRequestHeader()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">47. What is the purpose of the HTTP referer header in AJAX requests?</h3>



<p class="wp-block-paragraph">A. To trace the origin of the request<br>B. To identify the user agent<br>C. To set the caching policy</p>



<h4 class="wp-block-heading">Answer: A</h4>



<h3 class="wp-block-heading">48. What is the purpose of the HTTP user agent header in AJAX requests?</h3>



<p class="wp-block-paragraph">A. To trace the origin of the request<br>B. To identify the user agent<br>C. To set the caching policy</p>



<h4 class="wp-block-heading">Answer: B</h4>



<h3 class="wp-block-heading">49. Which method is used to detect the presence of an AJAX request in JavaScript?</h3>



<p class="wp-block-paragraph">A. xhr.detect()<br>B. xhr.status()<br>C. xhr.readyState()</p>



<h4 class="wp-block-heading">Answer: C</h4>



<h3 class="wp-block-heading">50. Which web development standard is used for AJAX requests?</h3>



<p class="wp-block-paragraph">A. HTTP<br>B. XML<br>C. JSON</p>



<h4 class="wp-block-heading">Answer: A</h4>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/top-50-ajax-interview-questions-with-answers/">Top 50 Ajax Interview Questions with Answers</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/top-50-ajax-interview-questions-with-answers/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to create custom pagination  without datatable in laravel microservice</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-create-custom-pagination-without-datatable-in-laravel-microservice/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-create-custom-pagination-without-datatable-in-laravel-microservice/#respond</comments>
		
		<dc:creator><![CDATA[Rakesh K]]></dc:creator>
		<pubDate>Thu, 06 May 2021 12:30:09 +0000</pubDate>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[microservice]]></category>
		<category><![CDATA[pagination]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6096</guid>

					<description><![CDATA[<p>Step 1:create button input in blade file Step 2: declare variable like curtpage, pagelimit and total record when you click [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-create-custom-pagination-without-datatable-in-laravel-microservice/">How to create custom pagination  without datatable in laravel microservice</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>Step 1:</strong>create button input in blade file</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1019" height="603" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagination1.png" alt="" class="wp-image-6097" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagination1.png 1019w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagination1-300x178.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagination1-768x454.png 768w" sizes="(max-width: 1019px) 100vw, 1019px" /></figure>



<p class="wp-block-paragraph"><strong>Step 2:</strong>  declare variable like curtpage, pagelimit and total record</p>



<p class="wp-block-paragraph">when you click the button then apply business logic inside jquery/javascript function</p>



<figure class="wp-block-image size-large"><img decoding="async" width="558" height="369" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagination2.png" alt="" class="wp-image-6098" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagination2.png 558w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagination2-300x198.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagination2-392x260.png 392w" sizes="(max-width: 558px) 100vw, 558px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="738" height="410" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/paginatio3.png" alt="" class="wp-image-6099" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/paginatio3.png 738w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/paginatio3-300x167.png 300w" sizes="auto, (max-width: 738px) 100vw, 738px" /></figure>



<p class="wp-block-paragraph"><strong>Step 3:</strong> when we get data after ajax success function  then apply logic</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="931" height="780" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi4.png" alt="" class="wp-image-6100" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi4.png 931w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi4-300x251.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi4-768x643.png 768w" sizes="auto, (max-width: 931px) 100vw, 931px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="954" height="839" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi5.png" alt="" class="wp-image-6101" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi5.png 954w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi5-300x264.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi5-768x675.png 768w" sizes="auto, (max-width: 954px) 100vw, 954px" /></figure>



<p class="wp-block-paragraph"><strong>Step 4:</strong> set routing in client side</p>



<p class="wp-block-paragraph">Route::prefix(&#8216;/touroperator&#8217;)-&gt;group(function () use ($namespace) {</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
Route::get(&#039;iternarydetail/{email}&#039;,&quot;$tourcontroller@getiternary&quot;);
</pre></div>


<p class="wp-block-paragraph">});</p>



<p class="wp-block-paragraph"><strong>Step 5: get token and client id  in client side controller using function</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="989" height="809" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/paginatio6-1.png" alt="" class="wp-image-6103" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/paginatio6-1.png 989w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/paginatio6-1-300x245.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/paginatio6-1-768x628.png 768w" sizes="auto, (max-width: 989px) 100vw, 989px" /></figure>



<p class="wp-block-paragraph"><strong>Step 6: set env and config flie</strong></p>



<p class="wp-block-paragraph">GET_MYHOLIDAYITERNARY_URL=/api/v1/j/iternarydetail</p>



<p class="wp-block-paragraph"><strong>Step 6:set Routing in server side</strong></p>



<p class="wp-block-paragraph">&nbsp;Route::get(&#8216;iternarydetail/{email}&#8217;,&nbsp;&#8216;Admin\AdminTPController@iternarydetail&#8217;);</p>



<p class="wp-block-paragraph"><strong>Step 7: apply  pagination query  inside sever side controller function</strong></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="468" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi8-1024x468.png" alt="" class="wp-image-6105" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi8-1024x468.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi8-300x137.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi8-768x351.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi8-1536x702.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi8.png 1681w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">finally  output view looks like</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="462" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi11-1024x462.png" alt="" class="wp-image-6106" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi11-1024x462.png 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi11-300x135.png 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi11-768x347.png 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi11-1536x694.png 1536w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/05/pagi11.png 1681w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-create-custom-pagination-without-datatable-in-laravel-microservice/">How to create custom pagination  without datatable in laravel microservice</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-create-custom-pagination-without-datatable-in-laravel-microservice/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to set a selected option using ajax in Laravel 5.6?</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-set-a-selected-option-using-ajax-in-laravel-5-6/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-set-a-selected-option-using-ajax-in-laravel-5-6/#respond</comments>
		
		<dc:creator><![CDATA[Chandan Kumar]]></dc:creator>
		<pubDate>Tue, 04 May 2021 06:50:50 +0000</pubDate>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Selected]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=6080</guid>

					<description><![CDATA[<p>Hey friends, I am trying to show database column data in my edit form of a Laravel project. yesterday I [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-set-a-selected-option-using-ajax-in-laravel-5-6/">How to set a selected option using ajax in Laravel 5.6?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Hey friends, I am trying to show database column data in my edit form of a Laravel project. yesterday I failed to show data from database in a select list using ajax. so let&#8217;s see the below blade file and ajax also to get your solution.</p>



<h5 class="wp-block-heading">edit.blade.php </h5>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;div class=&quot;form-group&quot;&gt;
  &amp;lt;label for=&quot;Blood_Group&quot;&gt;Blood Group&amp;lt;/label&gt;
	&amp;lt;select class=&quot;form-control&quot; id=&quot;bgroup&quot; name=&quot;bgroup&quot;&gt;
	  &amp;lt;option value=&quot;&quot; disabled selected&gt;Select BG&amp;lt;/option&gt;
	  &amp;lt;option value=&quot;O+&quot;&gt;O+&amp;lt;/option&gt;
	  &amp;lt;option value=&quot;O-&quot;&gt;O-&amp;lt;/option&gt;
	  &amp;lt;option value=&quot;A+&quot;&gt;A+&amp;lt;/option&gt;
	  &amp;lt;option value=&quot;A-&quot;&gt;A-&amp;lt;/option&gt;
	  &amp;lt;option value=&quot;B+&quot;&gt;B+&amp;lt;/option&gt;
	  &amp;lt;option value=&quot;B-&quot;&gt;B-&amp;lt;/option&gt;
	  &amp;lt;option value=&quot;AB+&quot;&gt;AB+&amp;lt;/option&gt;
	  &amp;lt;option value=&quot;AB+&quot;&gt;AB-&amp;lt;/option&gt;
	&amp;lt;/select&gt;
&amp;lt;/div&gt;
</pre></div>


<h5 class="wp-block-heading">profile.js</h5>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
$.ajax({
	type: &quot;GET&quot;,
	url: &#039;addprofile&#039;,
	data: null,
	success: function(response) {
          let data = response.data;
          $(&quot;#bgroup&quot;).append(&#039;&amp;lt;option value=&#039; + data&#x5B;0].bgroup+ &#039;&gt;&#039; + data&#x5B;0].bgroup+ 
           &#039;&amp;lt;/option&gt;&#039;);

        }
});
</pre></div>


<p class="wp-block-paragraph"><strong>Error </strong>: updated data from database is not showing in selected list when i am trying to update it again.</p>



<h5 class="wp-block-heading"><strong>Solution </strong>:</h5>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
$(&quot;#bgroup&quot;).val(data&#x5B;0].bgroup).attr(&#039;selected&#039;,&#039;selected&#039;);
</pre></div>


<p class="wp-block-paragraph">You can also use below code:</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
$(&#039;#bgroup option&#x5B;value=&quot;&#039; + data&#x5B;0].bgroup+ &#039;&quot;]&#039;).prop(&#039;selected&#039;, true);
</pre></div>


<p class="wp-block-paragraph">Above solution is working for me. so if you have more solution on select option then please feel free to comment and share your knowledge.</p>



<p class="wp-block-paragraph">Resources : </p>



<ol class="wp-block-list"><li><a rel="noreferrer noopener" href="https://stackoverflow.com/questions/40471307/how-to-set-a-selected-option-using-ajax" target="_blank">Click here</a> </li><li><a href="https://makitweb.com/auto-populate-dropdown-with-jquery-ajax-in-laravel/">Click here</a></li></ol>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-set-a-selected-option-using-ajax-in-laravel-5-6/">How to set a selected option using ajax in Laravel 5.6?</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-set-a-selected-option-using-ajax-in-laravel-5-6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AJAX Setup/ Installation</title>
		<link>https://www.scmgalaxy.com/tutorials/ajax-setup-installation/</link>
					<comments>https://www.scmgalaxy.com/tutorials/ajax-setup-installation/#comments</comments>
		
		<dc:creator><![CDATA[abhishek k]]></dc:creator>
		<pubDate>Sat, 13 Mar 2021 11:04:06 +0000</pubDate>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ajax installation]]></category>
		<category><![CDATA[install ajax]]></category>
		<category><![CDATA[setup ajax]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5520</guid>

					<description><![CDATA[<p>Ajax is a web development technique designed to create highly responsive/ interactive websites. To have a better understanding of AJAX [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/ajax-setup-installation/">AJAX Setup/ Installation</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>Ajax is a web development technique</strong> designed to create highly responsive/ interactive websites. To have a better understanding of AJAX we need to have knowledge of javascript and somewhat XML.</p>



<p class="wp-block-paragraph">The easiest way of<strong> implementing AJAX</strong>, is by using <strong>jQuery</strong>.</p>



<p class="wp-block-paragraph">To add jQuery </p>



<p class="wp-block-paragraph">We can use the downloaded version from (<a rel="noreferrer noopener" href="http://jquery.com/download/" target="_blank">jquery.com/download/</a>)  and we need to include the file location of the file in the script  under the header tag, or we can use the CDN  in the head of HTML as </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;head&gt;

&amp;lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js&quot;&gt;&amp;lt;/script&gt;

&amp;lt;/head&gt;
</pre></div>


<p class="wp-block-paragraph">After we are good to go with the operations we need to perform. If we wanna test that the CDN works fine we can use the function below in the body of the HTML script </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
&amp;lt;script&gt;
$(document).ready(function(){
    alert(&quot;jQuery Works&quot;)
});
&amp;lt;/script&gt;
</pre></div>


<p class="wp-block-paragraph">If we see the <strong>jQuery works</strong> alert, That mean we can congratulate ourselves on our success.</p>



<p class="wp-block-paragraph">For knowing what is AJAX and its procedure <a href="https://www.scmgalaxy.com/tutorials/a-brief-description-of-ajax/" target="_blank" rel="noreferrer noopener">https://www.scmgalaxy.com/tutorials/a-brief-description-of-ajax/</a></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/ajax-setup-installation/">AJAX Setup/ Installation</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/ajax-setup-installation/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>A Brief Description of AJAX</title>
		<link>https://www.scmgalaxy.com/tutorials/a-brief-description-of-ajax/</link>
					<comments>https://www.scmgalaxy.com/tutorials/a-brief-description-of-ajax/#comments</comments>
		
		<dc:creator><![CDATA[abhishek k]]></dc:creator>
		<pubDate>Sat, 13 Mar 2021 10:33:02 +0000</pubDate>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[description on ajax]]></category>
		<category><![CDATA[what is ajax]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5515</guid>

					<description><![CDATA[<p>AJAX&#160;stands for Asynchronous JavaScript And XML. It is a web development technique that helps to create a highly responsive website. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/a-brief-description-of-ajax/">A Brief Description of AJAX</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>AJAX&nbsp;stands for Asynchronous JavaScript And XML.</strong> </p>



<p class="wp-block-paragraph">It is a web development technique that helps to create a highly responsive website. by the use of AJAX, we get desktop-like software experience on the web browser. It is used in the web pages to be updated asynchronously by changing data with a web server behind the scene (in the background). This makes it possible to update parts of a web page, without reloading the whole page. It is the use of the XMLHttpRequest object to communicate with server-side scripts.</p>



<p class="wp-block-paragraph">The easiest way of implementing AJAX, especially if we&#8217;re planning on communicating with servers is by using jQuery.</p>



<p class="wp-block-paragraph">Most people get confused with the concept that ajax is a programming language. So, let&#8217;s be very clear that </p>



<p class="wp-block-paragraph"><strong>Ajax is not</strong> <strong>a programming language, it is a web development technique</strong> designed to create highly responsive/ interactive websites. To have a better understanding of AJAX we need to have knowledge of javascript and somewhat XML. </p>



<p class="wp-block-paragraph"><strong>Javascript </strong>is a scripting language that helps to make web pages interactive, <strong>CSS </strong>(Cascading style sheet) style sheet to the makeup of the webpage and <strong>XML </strong>(extensible markup language ) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. here <strong>javascript </strong>and <strong>CSS </strong>are essentials and <strong>XML </strong>is less essential for the beginners</p>



<p class="wp-block-paragraph" style="font-size:26px"><strong>Why use AJAX</strong></p>



<ol class="wp-block-list"><li>A whole page reload is not required on each request made.</li><li>Sends and receives data in the background.</li><li>Improves speed and performance.</li><li>Provides a better user experience. </li></ol>



<p class="wp-block-paragraph" style="font-size:25px"><strong>How AJAX works</strong></p>



<p class="wp-block-paragraph">Ajax uses XMLHttpRequest object (also called XHR objects) to achieve this</p>



<ol class="wp-block-list"><li>When the user sends a request from the interface then the javascript directs to the XMLHttpRequest object.</li><li>Then the HTTP Request is made to the server by XMLHttpRequest object.</li><li>Then the server interacts with the database using the JSP, PHP, Servlet, ASP.net, etc.</li><li>When there is a match for the request then the Data is retrieved from the database.</li><li>Then the Server sends XML data or JSON data to the XMLHttpRequest callback function.</li><li>Finally, when all the things are good to go then the web-page made (with HTML and CSS) is displayed on the browser.</li></ol>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="526" height="401" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/image-30.png" alt="" class="wp-image-5552" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/image-30.png 526w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/image-30-300x229.png 300w" sizes="auto, (max-width: 526px) 100vw, 526px" /><figcaption>How AJAX works</figcaption></figure>



<p class="wp-block-paragraph">For knowing the installation/setup  procedure link is given below <a href="https://www.scmgalaxy.com/tutorials/ajax-setup-installation/">https://www.scmgalaxy.com/tutorials/ajax-setup-installation/</a></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/a-brief-description-of-ajax/">A Brief Description of AJAX</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/a-brief-description-of-ajax/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
