localhost issue on page refresh, blank page - macos

I am working locally on a PHP site. I am on a Mac OS X Yoesmite and have setup Apache. But sometimes when i refresh the page it doesn't load, so I have to refresh the page again and again until it randomly loads my site again. When it doesn't load and I view the source it looks like this...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<!-- ERR_DNS_FAIL -->
</body>
</html>
Anybody know why this is happening or how I might go about fixing it as it's very annoying when trying to build a site and you have to keep refreshing the page until it loads.

I know(pretty sure) what was causing this issue now. I switched browsers developing because I noticed it was only happening in Chrome, so I was using Firefox. But then when I installed "Zapyo" browser extension in Firefox(I already had it in Chrome) the same thing started happening. So I just disable this plugin when developing.
So nothing to do with Apache configuration.

Related

Laravel don't load bootstrap on mobile device

I have a problem with the display of my site on mobile, I explain to you:
I state that I checked all the tags and the structure of my code there is nothing abnormal.
when I look at the site from the browser of my pc in mobile version everything seems to work, including the javascript bootstrap part
when I use my bootstrap phone it doesn't work and I see everything very small and not responsive
I have already tried to manually load the bootstrap CDN in the basic layout including the cdn of its javascript but nothing to do.
in desk version therefore on normal monitors everything works perfectly.
what can I do? thank you so much
to achieve that you should add this meta inside the <head></head> tag:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
for more information viewport meta tag

Don't prompt a user to install an app when trying to load a custom URL scheme

I have a page where I want to redirect users to the Instagram app when it's installed. That part works well, but when the user doesn't have the app installed it prompts them to go to the app store and download the app, which is not what I want.
I'm seeing this behavior on OS X in Safari, and the HTML involved is ({username} would be populated by my application based on the user submitting the form):
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0; url=instagram://user?username={username}">
</head>
<body>
<div>
Taking you to Instagram...
</div>
<script src="https://code.jquery.com/jquery-1.11.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
setTimeout(function() {
window.location = "https://instagram.com/{username}";
}, 200);
});
</script>
</body>
</html>
EDIT
Specifically, what's happening is the line <meta http-equiv="refresh" content="0; url=instagram://user?username={username}"> is showing the following dialog:
I'd like for that dialog not to display and let the "window.location =" in the take over and redirect the user to Instagram within the browser.
My question is how can I modify the "instagram://" redirect to not ask users to install the Instagram app on their machine?
There is no (official) way to detect in the browser if an app (like Instagram) is installed and thus you cannot use a custom url scheme without offering an alternative. You should let the choice to the end-user and prompt to open the website (https scheme) or the app (Instagram scheme).
The user will know if the app is installed.
If you know already that the user has the Instagram app installed, you can look at the browser agent to see if you are on an iOS device.

Debug gwt from inside iframe (X-Frame-Options)

When I try to debug my gwt app that's inside an iframe (note that gwt codserv and webserv are all local) I'm having permissions issues. The following errors are thrown:
on Chrome console: "Refused to display document because display
forbidden by X-Frame-Options.";
on Chrome webpage window: "Plugin
failed to connect to Development Mode server at 127.0.0.1:9997 Follow the underlying troubleshooting instructions"
This ONLY happens in Google Chrome, firefox and IE are ok.
I've already searched for simillar problems but all of them are on crossdomain context, and mine is local. Also, tried the proposed solutions but all without success.
Here is an example of my webpage containing my iFrame. I can't debug MyGWT app.
<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<iframe src="MyGWT.html?gwt.codesvr=127.0.0.1:9997"></iframe>
</body>
</html>
The page that's being blocked is probably TroubleshootingOOPHM
FYI, this has been fixed in GWT 2.5, which now links to this page rather than trying to display it in an iframe (moreover underneath the error glasspane, which made it hardly readable anyway before Google changed their server settings)

Using Eclipse PDT for debugging Ajax pages with concurrent requests

Once I asked this same question but now I can give a test case for it.
The problem resides in debugging in Eclipse PDT when the page sends multiple requests to the server's dynamic pages. Consider a web page as follow:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script src="link-to-jquery/jquery-1.7.2.min.js"></script>
<script>
$(document).ready(function() {
var list = $("ol");
for (var i=0; i<20; i++) {
list.append($('<li><img src="/img.php?'+i+'" /></li>'));
}
});
</script>
</head>
<body>
<ol>
</ol>
</body>
</html>
In above page, JQuery is used only to prevent browser from caching the images. And the the img.php reads like this:
<?php
readfile('some_image.jpg');
When I try to debug the first page in the Eclipse PDT, using Zend Debugger, only the first img.php request is made and others are dismissed. A sample output is shown in the attached image file. In the presented case, not loading an image file won't prevent you from debugging the rest of project. But once there's a javascript file which isn't loaded because of this problem, the rest of project won't work as it has to. Does anyone know how can I debug such a page?
Here are my specifications:
PHP Version 5.3.14
Zend Debugger v5.3
Eclipse for PHP Developers, Version: 3.0.2
Apache/2.2.22 (Ubuntu)
I found that this problem is specific to Zend Debugger and XDebug works smoothly.
+1 for XDebug, -1 for Zend Debugger

IE8 compatibility mode...help?

I'm trying to setup compatibility mode in one of our web products however I cannot get compatiblity mode to work via a particular server.
To recount what I've done so far:
I've set the the HTTP header X-UA-Compatible in IIS to IE=7
I've set also addded the meta element as the first element in the head element to the master page:
Using fiddler I've checked the HTTP traffic and I can see the header value and the meta element. Using the same browser (different tab) when I point to our staging server the document renders as IE7 brower mode and IE7 document mode. Which is great. Unfortunately when I point to the live server which is configured in the same way as the staging server the document renders as IE8 browser mode and IE7 document mode.
As a result when I check the dev tools the CSS which is being applied to the html element is
" ie ie8 CSS1Compat Win32"
vs
" ie ie7 CSS1Compat Win32"
Has anyone got any suggestions what I might have missed?
Note there is a blank line before DOCTYPE instruction (which is meaningful).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/2006/btl"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:e="http://www.backbase.com/2006/xel"
xmlns:c="http://www.backbase.com/2006/command" xmlns:d="http://www.backbase.com/2006/tdl"
xmlns:x="http://woodmac.com/x">
<head><meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><meta http-equiv="expires" content="-1" /><meta name="robots" content="index,follow" />
<script type="text/javascript" src="Backbase/engine/boot.js"></script>
<link href="App_Themes/MANDA/print_style.css" type="text/css" rel="stylesheet" /><link href="App_Themes/MANDA/screen_style.css" type="text/css" rel="stylesheet" /></head>
<body>
Thanks,
Philip
Take a look at this site and see if you missed anything. It may be related to the doctype, but it looks like the meta tags should override that.
What url are you using to access each server? IE8 has an option which is enabled by default which will force "intranet", or single-name, domains to render in compatibility mode regardless of your XUA and other header settings (Tools > Compatibility View Settings > Display intranet sites in compatibility view).
If this setting is enabled and you are accessing one or the other of your staging and prod sites with something like http://servername, then this may be causing them to render differently regardless of your setting.
Recently I was faced with this issue and ended up requiring all servers to be accessed with a domain extension (e.g. http://servername.company.com), and set the XUA header to IE7. Now everything renders in IE7 mode regardless of the server its running on.

Resources