Iframe problems with my webpage - url

I have some problems with my website, I make an template called index.html (maybe not smart) but now I have the following problem.
When someone go to the site directly it works perfect, but in Google it's a different story. Google displays the URL directly to my contact page.
http: //..............nl/contact.php when you click on the link, the template (index.html) is not opening with the contact.php. The only thing you see is text.
is there some thing to check if the index.html is included and otherwise add it to the page?
something like:
if(file_exists('index.html'))
include '0'
else( include'index.html');
or a redirect or something.
Who can help me?

Redirect to index.html if contact.php is not loaded in the iframe.
In contact.php :
<script>
if(window===window.top)
location.href = 'index.html';
</script>

Related

Wrong WordPress links redirection

I have a WordPress web site and the site links was working good. For the last two days, suddenly found web site links redirect to the home page not the target link page. I checked the links code it's okay. I inspect links in the browser and I found this code changed for all links like this :
اتصل بنا
This means the right link code in ohref property and the alternative link code in href so all links open the main page for domain in href property.
What is the solution and what caused this problem?
href="" is where the link is directing. ohref="" is a custom attr that can only work with a javascript function. So unless you have an on click listener with javascript it has no function.If there is a javascript function it will overwrite the href="" with a preventdefault()

Why aren't styles loading in second page in jQuery mobile?

Below is the part of screenshot of mywebsite/index.php, a PC site with NO jQuery Mobile (JQM), with all scripts and styles.
Below the screenshot of mywebsite/mobile/options.php, a page designed to be run on mobile browsers, having JQM.
Here is the HTML script for Logout button, actually an ahchor tag:
Logout
.. refers to the main mywebsite folder out from mobile folder.
When I tap/click Logout, it should go to mywebsite/index.php, the PC site. And here's what shows up:
If I display the location using alert(document.location);, it shows - mywebsite/mobile/options.php.
I have to press F5 to view the page as it should.
I know that this is happening because JQM loads the pages AJAXually and hence ignores all scripts and stylesheets outside of BODY tag. I know this question is duplicate of many questions in StackOverflow and I have tried my level best to find a solution, but can't find one.
How do I move to the index.php without need to refresh?
You need to add additional code to your logout.php file to execute after the logout code executes. PHP headers can accomplish this. Within your PHP tags, add this to the end of your code:
header( 'Location: http://mywebsite/index.php' ) ;

jQuery Mobile: How can I link to an external page without breaking web app view?

I created a web app (without browser chrome) which loads most of its pages locally from index.html. Now I have one page which i can not integrate into index.html, since it has to be refreshed when loaded. I placed it on the same server and called it stats.html and link to it like this:
Stats
When I click this link, the browser pops to the front instead switching to the page without browser chrome.
How can I link to an external page in a way that it still looks like one app?
I appreciate any hints to solve this problem.
just found https://github.com/mrmoses/jQuery.stayInWebApp that seems to be the solution.

Embedded video not rendering in Chrome on first load after embed code is saved to a Rails model

We have an Ruby on Rail app that allows the user to save a number of video embed codes into a into our data model. The form allows the user to enter any number of embed codes, press submit and save everything to the database. The app then redirects the user to a page that has a list of all the embed codes.
This workflow works fine for IE, Safari, and Firefox.
On Chrome, however, the first time the page is loaded none of the videos appear on the page. I see the following error in the console, once for each video:
Refused to execute a JavaScript script. Source code of script found within request.
On subsequent page loads, the videos load fine and that error is not displayed.
When I view source, the page is reloaded for the view-source operation so I cannot tell if the source is coming through as expected.
When I inspect element on the block where the video should be, I see the following:
<iframe src="" width="400" height="225" frameborder="0">
<html>
<head></head>
<body></body>
</html>
</iframe>
This occurs for both the iframe style embed codes as well as for the "old-style" tag code for both YoutTube and Vimeo videos.
Related:
Refused to execute a JavaScript script. Source code of script found within request
It's how Chrome prevents XSS (cross-site scripting), as your reference above.
When you submit your embed codes, and redirect to another page to display them, Chrome sees that the submitted embed codes (via HTTP POST))and the responded embed codes are the same, so it prevents to load them and displays error in the console.
When you refresh the page, no more HTTP POST submitted (because you redirected it before), so it should display correctly.
I have same problem, and I resolved it by auto reloading the page after it redirected.
I reload the iframes via javascript (with jquery) as workarround..
I therefore store the src elsewhere cause chrome removes it..
I added the url twice as src and src2, and reloaded then with src2.
I also gave all the iframes that need reloading a special class 'webkitIframeHack'.
<script type="text/javascript">
$(function(){
if ($.browser.webkit) {
$("iframe.webkitIframeHack").each(function(){
$(this).attr('src', $(this).attr('src2'));
});
};
});
</script>
(I can't use html5 data-* attributes, i think they would be more fitted..)

Something wrong with redirects on my Joomla 1.5.18 site

My Joomla 1.5.18 site, I enabled login, when I click login the page I get sent to is NOT styled with CSS. If I login it redirects to the home page and it is not styled anymore either.
It looks like it is recursively appending stuff to the URL incorrectly.
http://www.myjoomlasite.org/index.php/index.php/login
if I click on home page or login links it keeps putting more and more index.php entries in the URL, and sometimes on the end. The following is what I get when I try and go to a JEvents menu item.
http://www.myjoomlasite.org/index.php/index.php/index.php/index.php/upcomingevents/month.calendar/2010/06/09/index.php
Anyone have any idea why this is happening? I don't know what to search for on Google apparently, and none of the Joomla! books I have address this.
I figured it out I had turned on Search Engine Friendly URLs in SEO Settings under Global Configuration. Turning this back off fixed the problem. Now I guess another question will be along the lines on how to get the Search Engine Friendly URL's to work again.
Make sure you link to stylesheets and images using a link that starts with a leading slash and therefore counts from the root.
It is the browser that evaluates the URL for those resources, based on the URL of the currently viewed HTML page. Never use relative links for these resources.

Resources