My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Showing posts with label browser. Show all posts
Showing posts with label browser. Show all posts

Tuesday, August 20, 2024

Resolving 'Failed to Fetch' Errors in JavaScript

The "TypeError: Failed to fetch" error is a common and often frustrating issue encountered when working with web applications. This error usually arises from problems with the Fetch API and can be caused by a variety of factors.




Common Reasons for "Failed to Fetch" Errors

1. Incorrect or Incomplete URL

   - The URL used in the `fetch()` method might be incorrect or incomplete.

   - Make sure the URL includes the correct protocol (https:// or http://) and that the path is accurate.

2. CORS (Cross-Origin Resource Sharing) Issues

   - The server might not be returning the correct CORS headers. If you're unfamiliar with CORS, you can refer to the MDN documentation.

   - Ensure the server is configured with the appropriate `Access-Control-Allow-*` headers.

3. Incorrect Fetch Configuration

   - There could be errors in the HTTP method or headers passed to the `fetch()` method.

   - Double-check that the configuration, including the URL, HTTP method, and headers, is correct.

4. Browser Extensions

Occasionally, browser extensions can trigger these errors by interfering with API calls or altering the responses.


Steps to Debug


1. Verify the URL

   - Ensure the URL in the `fetch()` method is correct and complete.

   - Check that the protocol, path, and HTTP method are accurate.

2. Inspect the Browser Console

   - The browser console can provide valuable insights into failed API calls.

   - Look for errors related to CORS or other network issues.

3. Check CORS Headers

   - Confirm that the server is sending the correct CORS headers.

   - Use the browser’s Network tab to review the headers of the failed requests.

4. Experiment with Different Configurations

   - Try different `fetch()` configurations to pinpoint the issue.

   - Adjust methods, headers, and URL formats as needed.

5. Consider Using a Proxy

   - If modifying server headers isn’t possible, consider using a proxy to bypass CORS restrictions.

   - Implement proxies with tools like Express or `cors-anywhere` in Node.js.




Wednesday, November 1, 2017

Delete Cache & Cookies for specific website in Non-IE Browsers like Chrome and Firefox

At times, we may feel the need to delete or clear the Cache & Cookies for a specific website only – and not the entire Browsing History – especially if you face errors like 400 Error or Server / inaccessible errors.  Sometimes, for a .Net type of application, you also get errors like the constructor to deserialize an object of type 'Autofac.Core.DependencyResolutionException' was not found.


In all such cases, you have already seen how to Clear Internet Cache & Cookies for a particular domain in Internet Explorer. Now let us see how to do it in Chrome and Firefox browsers.

Normally, we simply the entire Cookie cache of that browser. This will mean that, when you exercise this option, you will be clearing all the Cookies. But if you don’t to do this, you will have to clear the Cookie for that particular domain only.

Clear Cache & Cookies for specific website in Chrome

Open your Google Chrome browser and then open its Settings. Click on Show advanced settings and the scroll down till you see Privacy.

Now click on the Content settings button. You will see a new panel pop-up with settings for Cookies right on the top. In newer versions, scroll down some bit and you will see this screen.

Search here for the website whose cookies you want to neutralize. Click on the All cookies and site data button to open the following panel.


Delete Cache & Cookies for specific domain in Firefox

Open your Mozilla Firefox web browser and then open its Options. Select Privacy next. Here under History, you will see ‘You may want to clear your recent history or remove individual cookies‘. Click on the ‘remove individual cookies‘ link to open the following panel.


Search for the domain, select the Cookies you want to delete and then remove those Cookies.


You can also use CookieSpy a freeware that lets you manage Cookies of all Browsers in one place. Use it to delete Cookies from a particular domain.



Wednesday, July 13, 2016

Refresh All the open tabs in Chrome browser instead of F5 each window

Ever encountered the issue of lost connectivity and on regaining connection the need of refreshing all the open tabs in chrome browser. Yeah! sounds similar. Isn't it?

Basically you will need to refresh all the tabs in following circumstances:
1. You have opened tabs and network loses and comes again after sometime.
2. You have hibernated machine and on restart want to refresh each tab
3. you open some websites or a list of saved bookmarks, but gone for a cuppa coffee and return again.

In all the above scenarios you need to go to each and individual tab and hit F5 or Refresh. Actually this was what i have been doing for quite some time.
And, trust me I was really very upset about that. I knew there would be some solution, but installing just another plugin for this was a not-my-type solution.

And, finally my Columbus heart discovered AmericA! Yo:)

Refreshing All the Tabs in Chrome is actually very easy. Thanks Google Dev Team for that. But at the same time, I would be angry with them ( anger of a beloved!) that why have they hidden this for so long.


To do this you need to treat the tabs as if they are some files or folders in System explorer. Just click on the first tab. Hold down the shift key. And, finally click on the last tab. This would light up all the tabs, if you see minutely. Actually, its an indication that all tabs are activated or selected. Now just right any tab and click on reload or do an F5. This would refresh all pages.




Friday, December 16, 2011

GeoBing by Anwar Faiz: First Facebook App using Bing Maps

I have developed a new Facebook Application and wanted to post something about that.


Name of the Facebook App: GeoBing

Description: Use the GeoBing App to share your location on Facebook using Microsoft's Latest Bing Maps. Your Profile would get updated with your current location and map.

Importance: GeoBing Facebook Application is the world's first innovative way to share your Geographical Location over Facebook using Bing Maps. You can even do it from your Laptop and Desktop Browsers.!!

GeoBing FaceBook Link: http://apps.facebook.com/geobing/?ref=ts

Steps to use:
Step 1: Click this button Show map. [You need to click this]

Step 2: When prompted, allow your location to be shared to see Geolocation in action

Step 3: When you see your Location information on the Map below, Click 'Post to Facebook' button on the bottom.

Effect: Your geographical location would be posted over your Facebook profile page.

Help promoting this App. This was designed in curiosity to use Bing Maps. And I am happy and glad to let you all know, GeoBing is the first Facebbok Application that uses Microsoft Bing Maps to post your Geographical location. This works from your desktop, laptops, handheld devises, Samsung Galaxy S2, Iphone, Ipads etc.

Love u all.
Keep clicking advertisements. Keep reading more original contents.
-Mohd Anwar Jamal Faiz

Friday, May 14, 2010

Cool Trick with website images!!!

Mathematics in itself is a fun and sheer joy if you are able to see through its beauty.

I feel that as you keep on realizing the application of mathematics and its ideas in different branches of science, philosophy and technology, you will start enjoying every aspects of it. Especially, I find the number science and the effects of simple functions on the ranges that a domain of inputs can bring as amazing. 

Let me show a simple trick using Javascript. It will use a great mathematical trick. Please feel free to dive into it if you want.

Remember that JavaScript is a popular scripting language. It powers the most popular Web 2.0 applications with a combination of web development technique called AJAX.
However, Javascript can and is very well employed to create stunning effects in Web pages.

In addition it can also be copied and pasted in the address bar of a web browser. This will run the javascript code in the address bar over the webpage/document already loaded in the browser.

Lets stop gambling with words. Some men (women too!) really need action. So, here it goes...

Steps:
1. Open a web page with some pictures/images
You may even try with this webpage itself (so no need to open new)
or, You may also open http://images.google.com and search for whatever you like eg. cartoon.
2. Copy and paste the following code in the address bar of your internet browser.

############################################
javascript:R=0; it_discussions=5;x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function mohdajf(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.mkssddddddddddd=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('mohdajf()',it_discussions); void(0);
#############################################

Voila!! The pictures have started dancing!
This is a single manifest of the power of Mathematics used with Javascript!

It is evident that there can be much of fun with this one line of code.

In case, you modify the code to create yet another stunning cool image motions, please share it on IT-Discussions Blog.