How can I Found what is causing crashing page in Mobile? - javascript

I have a problem:
Cart and checkout page in the mobile version: on scrolls page refreshed and suddenly crashed and in safari, I get this error: a problem repeatedly occurred.
I checked the following ways but I couldn't find what caused this problem:
I enable WP_DEBUG and fix all errors.
I check each single js file structure in online tools that check the
structure of JS files.
I create wp-content/mu-plugins and disable unnecessary plugins on these pages.
I removed .css and .js files of the theme to see if this file caused
this error.
I checked the console in inspect mode. and there is no error there.
Would you please share your experience what else I should check to see the reason of the

Related

Strange problem after compiling reactjs boilerplate

Upon first use of the create-react-app boilerplate everything seems to be fine. Prompted with the Edit src/app.js and save to reload, however, after making a change to app.js for example instead of edit src/app.js I change it to testing change; once I click save everything reloads console prints Compiling... Compiled Successfully! the browser automatically reloads the content on the page only to find it everything is blank like the default index.html and to add to my confusion further saving of any file within the project tree reloads the pages to the default Edit src/app.js and save to reload even though that string no longer exists inside of App.js.
TLDR:
Obtained create-react-app
create-react-app client
npm start
Page shows default
edits App.js changing the display text
Page stays white after console compiles saying compiled successfully!
Resaves file causing it to compile twice.
Once the second compile is done page goes back to default template not displaying new information
Chrome Browser Console
Console prints out nothing only telling me to get the react-devtools extension for chrome.
Terminal
Compiling...
Compiled successfully!
I had the same issue. Post change the screen was white and the console said [get the extension]. I reacreated the app boilerplate multiple times and reloaded the app multiple times.
Default App.js:
I would love to have a more scientific solution but this worked for me:
I opened the f12 in chrome at the white screen [console said the same stuff] and then reloaded the page. Then, my changes showed. I made changes and saved. Live updates [without refreshing browser manually] started working.
I closed the F12 tools and live updates continue to work.
My assumption here is that loading the page with the default F12 tools was enough to get this primed. I do not think it was a waiting thing as I left this overnight after cursing it and walking away. I wish I had a better answer but this worked for me.
Subsequent [nmp start]s did not require the tools activation to let the page work and show live updates. I hope this is duplicateable for others.
Loading the react tools extension now.

Magento Setup AngularJS Error

I just setup the newest Magento 2.1.9 in a Docker environment and wanted to start the setup but the setup-interface never loads.
I get a few JS / Angular related errors in the console:
The Javascript files on the page all load normally so I don't see a server error here but maybe I'm missing something.
I can't find anything related to that problem on the support forums etc.
Network Tab:

How to debug when javascript doesn't load

I have 2 sites using the same theme. (http://www.kentishtowner.co.uk and http://here-is.com/kentishtowner-old/ )
They are WP multisite subsites, both using the exact same child theme (same template files exactly).
However, the former website is not loading javascript, causing the masonry layout and mobile menu to not work!
I assume this is something to do with when I mapped the domains, or changed the URL from something like here-is.com/kentishtowner-new to here-is.com/kentishtowner, before domain mapping...
As I am not a JS person, can someone give me some insight as to how I can go about debugging this?
I haven't slept a wink last night and it's now 11am - am getting an hour's shuteye, and would hugely appreciate any responses!
Thanks!
In Chrome's console you'll see
Resource interpreted as Script but transferred with MIME type
text/html:
"http://here-is.com/?dm=c078877dcf0e3101dc20cc337a8e4214&action=load&blogid=13&siteid=1&t=1522670393&back=http%3A%2F%2Fkentishtowner.co.uk%2F".
In fact, further digging shows that here-is.com is returning an empty response to that request.
The page is actually referring absolutely to a number of resources on here-is.com and that works fine when you access it via that domain, but has issues when you access via www.kentishtowner.co.uk. I don't know enough about your setup to say for sure how to resolve it but you probably need to configure the base URL of the project to tell it where it's being deployed, or if you can tell it to use relative links that would work too.
(In Chrome's developer tools you can hit ctrl+shift+F and type here-is.com to see the references)
Browsers have consoles where javascript errors are thrown. They will tell you what error was thrown, and where it was thrown from. Once you know that, you can google around to see if there is anything obvious to fix.
My guess, though, is that somewhere the site that isn't working is trying to use a script that was hosted on the working site. If that's the case, you just need to update the script paths.
--edit--
Fortunately for me (from what I hear), I have never used Wordpress. Unfortunately for you, I don't know how to tell you where the .js files would be located, or how they are organized at all.
I usually debug in Chrome, so this is how you can check to see if your page is able / unable to get an external script.
When you are focused on the page you're having a problem on, hit F12 to open up the dev tools in Chrome.
Click on the Network tab, and then hit F5 to refresh the page.
Click on the Type table header, and look for files that say text/javascript. Those will be the external script files your site is requesting.
Look at the Status column for each of those rows. If it doesn't say 200 OK., then your page isn't able to access the corresponding script.
From there, you would need to find where those scripts are supposed to be located. Once you know that, just find the scripts from the other site, and copy them into the correct location of the broken site.
Good luck!

Relative Links Not working on HTML page

There is an issue I am facing in HTML page.
I have included a javascript code in that page due to which ActiveX warning message is thrown each time the HTML page is uploaded on local system.
To stop this warning being shown to the users, I have used MOTW (Mark of the Web) and included this code snippet at the top of the HTML Page:
<!-- saved from url=(0016)http://localhost-->
This line of code prohibits the warning prompt message.
But now the relative URLs on the page have stopped working.
Please help me find me a solution so that neither the ActiveX warning arises nor the relative links on the page should stop working.
Thanks in advance.
The ActiveX warnings should only arise when you are accessing your site from the local file system, for security reasons. When you access it through a (local or remote) web server the warnings should be gone.
Can you not use Apache (included in XAMPP), or something similar, to serve your pages (even locally, through http://localhost/)?
Edit:
Alternatively, you could disable that particular security setting in Internet Explorer (which I assume you use, because you mention ActiveX). Or you could try a different browser: Firefox, for example, does not have these restrictions.
Have you tried using a <base href="ENETERBASEURLHERE" />

Wordpress not loading javascript file

I have just uploaded a wordpress site from previously developing it on my localhost. On my localhost there are several plugin javascript files that are picked up and used to display a tooltip on the google map plugin for the markers.
On my localhost this all works fine but when i uploaded this through FTP, some of the javascript files appear to longer be loaded. Is there any way to check which files are being uploaded when the page is loading the javascript?
Whenever i try to check or edit the file from Filezilla, it gives a Microsoft JScript runtime error, Code: 800A1391, Error: 'document' is undefined, so i can't check that what the host uses is the exact same code as my localhost.
Many thanks,
Dan
Most browser developer toolkits (Dragonfly, Chrome Developer Tools, Firebug, etc) include a Net tab which will tell you which files have been requested and the status of them.
Try using either firebug http://getfirebug.com/ with Firefox or the Chrome web inspector and look at the (Net/Network) panel while you reload the page to see if the js files are trying to load. This should give you some insight.

Categories