HTML Page on Local vs Server Issues - javascript

So I am having an issue with the way my page appears on the server compared how it is working locally on my computer. Here is the code I am using: http://pastebin.com/pbDbNsNU -- There are no console errors, nor are there any issues with the code when displayed locally.
Once put on the server: http://devtherrd.com/thank-you/mortgage-lending.html -- you'll notice my footer's right hand side columns are completely gone. This only happens once put on server, but I am not sure why this could be happening since these are basic social media links and newsletter form. The same footer is working throughout the entire site, except for all my files within the /thank-you folder structure.
What recommendations do you for me. If there is missing information please let me know I can provide, I apologize in advance for my complete noob posting.
Thanks

Validate your code with:
https://validator.w3.org/nu/?doc=http%3A%2F%2Fdevtherrd.com%2Fthank-you%2Fmortgage-lending.html
There are HTML errors.

From what I have seen, the file which you uploaded on your server is incomplete.
It doesnot have the code to display that part. But the code you provided on pastebin works fine. So update the html file on the server. Your problem should be fixed.

Related

Other host and my client side function properly but my server side fails at onClick Javascript youtube player

Using the pure html source code from the website below for a responsive youtube player on server side, it runs identical to the hyperlink's host. When I upload this into file into my google cloud server, the onclick function fails to change the ID attribute. The scrolling and other java works fine. Competently identical code.
http://woosterwebdesign.com/experiments/youtube-player.html
1st fail: link a script.js and structure the code differently
2rd fail: Change the javascript formatting.
https://stackoverflow.com/questions/27140952/how-to-change-video-source-onclick
https://stackoverflow.com/questions/23693118/how-to-change-multiple-attributes-of-a-link-using-onclick-of-radio-button
https://stackoverflow.com/questions/41354535/how-to-update-youtube-video-id-when-clicking-different-play-buttons
3th fail: After reading many variations on stack and such, I found this demo below and uploaded the identical code and now see the same problem persist.
https://jsfiddle.net/u3bntba6/
At this point i'm certain it's somehow the google cloud. After apache2 trials and tribulation, I figured I didn't have something properly installed on Google Cloud Platform VM.
4th fail: test and confirm that JQuery is installed and not the fault
Now I'm days deep in reading and I'm not sure what I'm looking for. I enjoy reading but can't find what I don't know. Any advice on how to get my server hosting a working youtube playlist would be highly appreciated.
After cycling my code into the server,
copying the code from the browser and re-pasting into my notepad,
saving,
and uploading again into the server.
I have noticed certain code is displayed with additional text that once ran again would cause functioning error. This can be easily mimiced by copying the element of an embedded youtube player and noticing additional code after the ? (meaning the break)
Same thing happened with my paypal button code. It must be an intentional layer of security. Except this time the code was rewritten in a way that could not be fixed without source. This is more likely js side I believe.
It is very likely if you're experiencing this in the future, you have broken code hiding in your html and javascript.

What am I doing wrong with Angular js manual bootstrap process?

I am using Angular 1.7.2 in a project i'm working on. (I prefer Angular 1.x)
I am doing the bootstrap process manually (because i'm adding scripts programmatically).
But, I am having 2 issues with the manual bootstrap process.
I have to use a setTimeout, else the bootstrap never works. And my problem with this is, the more files I add to my project, the longer i have to make the timeout.
Sometimes when I load my web page or refresh the site, not all my components are loaded. If i monitor the network traffic, i can sometimes see that the html files are not retrieved at all. And there are no errors in the console or anything.
It seems to me there must be something happening in the angular.boostrap process that is failing or getting stuck, but i can't figure it out.
For my first issue, why is the setTimeout required, is there a way to not need this?
Second, why does my site not load sometimes?
Could it be related to the OS locking the files temporarily because of all the source control, anti-virus, other services running on my computer? If so, how can i tell?
I put together a test project with relevant code here on github
I previously thought this was related to the routing, but it's not (see here), But it seems not related to angular-routing after all.
Any information would be much appreciated, this is driving me mad.
Update 1:
I have the code running here on github pages.
Best chance to replicate issue is to use google chrome, enter url, open dev tools (f12), then actually load url. Sometimes, the page doesn't load completely.
I have updated the test website to better reflect my project where I add scripts dynamically.
I think i found the solution thanks to a comment by igor
I moved my app.route.js file to be loaded before any of my angular component and directives and from what I can tell this solves my problem.
I will update the linked sample project too

Why does the WebBrowser control not display HTML correctly after it has been saved?

I've read a lot of related answers but I still don't see the problem. I think MY problem is that I don't have a good grasp of the basics of HTML and potentially javascript. I'm talking about how they are stuck together and operate, not the particular language syntax. Perhaps somebody could give me the big picture explanation of what is going wrong here.
I'm using a simple WebBrowser control to navigate to a web page. This results in everything displaying correctly. Now, I'd like to save that HTML content locally on the machine and open it again later, then render it in another WebBrowser control. This has not worked so far. The page renders briefly but without images and effects, then I get an exception regarding scripts. So I decided to do a very simple test. I would get the HTML from the browser, then immediately read that text back into the browser.
After navigating to the page successfully, I get the HTML text as follows:
string html = myWebBrowser.DocumentText;
I then immediately set the DocumentText property to its original value.
myWebBrowser.DocumentText = html;
This gives me the same error and effect as if my other application was reading the saved HTML. So what is going on here? The browser initially shows all content successfully but then extracting and reloading the HTML text breaks it all. I must be missing a very obvious and basic concept here. Is it that the WebBrowser control's DocumentText property does not actually return the original HTML code, but rather a modified version? Or is it that setting that property modifies something? Is it neither? Thanks to anyone who can sort out my understanding of how all this works.
This is by design. HTML is not a fully inclusive file. The browser will parse the html and pull resources from other urls including scripts, images, styles, etc. If you save only the html and then open that file in a browser, many of the resources will not be found since they rely on the html loading them from their location relative to the html file. Once the file is on your computer, any relative link to a resource will be invalid resulting in the browser only showing the basic html and any resources that have been referenced by absolute paths and not relative paths.

JS Injection in Wordpress

I just upgraded to WP 4.3.1 on one of my websites. After upgrade (which seemed to go with no problems at all), I noticed that the layout of my pages has changed. There is a bar across the top of my page (not the admin bar) that wasn't there before. When I inspect the element there, I see a whole bunch of new code that is not being created by any of my plugins. And I cannot find the source of this injection in any of the provided php files. I have no idea where it is coming from, but I suspect that something in the WP 4.3.1 package has been compromised, or maybe there is a callout to a site somewhere that injects this code.
Anyway, this is a BIG problem and I don't know how to fix it.
I've copied the injected injected code below. It appears in all the pages on my site, right below the tag. Interestingly it can only be seen by "inspecting element" in the browser; page source does not reveal it (I've added some line breaks to make it more readable, but this is exactly what shows up in my page.
This same problem occurs on every site where I upgrade to WP 4.3.1. I hope someone can fix this problem IMMEDIATELY!!
Clearing cache, history & cookies doesn't resolve the problem. I can't tell where this injected code is coming from. Also, Google doesn't seem to be much help in telling me anything useful about http://kfc.i.illuminationes.com/snitch, which is one of the links that is being created.
Our site was infected, this is what we did to get rid of it
Thanks to this discussion which led me to a more detailed one
Connect via ssh to the server
Check the directory structure and find out recently created / modified directories
Check recently modified files for <script>. I found many files having JavaScript inserted which would connect to external sites.
As these calls were made on each page, I checked header.php in wp-content/themes/your-theme directory. (check the ones you are not using as well as that might be infected but may not show in radar)
You might also want to check footer.php for infection.
Re check file permissions on server as per WordPress Hardening guidelines on Codex
Delete unrequired ftp accounts in FileZilla (or its equivalent)
If you use any caching, delete entire cache.
You can verify if this worked using devtools network tab.

Multiple Js files not working in Google Chrome

I have a weird problem here, i have a page called index.php where in the head section i am including 5 Javascript files, but all of them are not working except the first js file. When i move my entire code to one file they start working but the moment i switch them back to from where they belong they stopped working and i have tried including the files before the body they don't work.
Any help
Thanks
Long story short: Save all of your files in UTF-8 format and try your page again. :)
I had the same exact problem. It was driving me mad, because I know this works! Many sites on the Internet include several JS files, and they were all working.
I finally figured out that my code editor (Notepad++) was set to save files in ANSI format. I changed the editor's setting to save files as UTF-8 and everything is working again.
I found this by opening the Chrome developer console on the broken page (Ctrl+Shift+I). I expanded the "<head>" section, and saw three "<script>" entries. I double-clicked on the link in the "src" attribute of the second "<script>" tag to see if I could at least view the broken JavaScript file from within the developer console. When the new page opened, it gave me a syntax error and showed me a bunch of Chinese characters. This was my clue that the file over on my web server had been saved in some format that my browser was not interpreting correctly.

Categories