Jquery :: Avoid Loading JS File In IFrames

Nov 17, 2010

Is there any method to avoid loading js files of iframe. For example, if I loaded jquery from the main (parent) page, and don't want to load an 'extra' jquery of iframe. How could it possible? Generally, it is about calling javascript functions in iframes, which is already loaded from parents.

View 4 Replies


ADVERTISEMENT

Keeping Iframes From Loading

May 19, 2005

<pre>
<html>
<head>
<title>Snapitup Script</title>
<style type="text/css">
*{margin:0;padding:0;}
</style>
<script type="text/javascript">
/* script made by gmn17@hotmail.com &copy; 2005 free to use */
/* keep this script credit intact,thanx, a script to show/hide */
/* any html in IE Safari and Firefox, if you wish to preload */
/* just put it in the target, stripped out table and eval */
/* statements from 2 scripts and combined them, then altered */
/* part of a www.shawnolson.net script took eval statement out */
function snapitup(target,statement){
string = 'theTarget = document.getElementById("'+target+'");'
if(theTarget != null){
theTarget.innerHTML = statement;
}
var el=document.getElementById(target);
var theTarget=document.getElementById(target);
if(el.style.display!="none"){
el.style.display="none";
}else{
el.style.display="";
theTarget.innerHTML = statement;
}
}
/* use this to preload content */
function hideShow(target){
theTarget = 'document.getElementById("'+target+'");'
var el=document.getElementById(target);
var theTarget=document.getElementById(target);
if(el.style.display!="none"){
el.style.display="none";
}else{
el.style.display="";
}
}
</script>
</head>
<body>
<a href="#null" onclick="snapitup('row22','<iframe src=http://www.yahoo.com width=100% height=500px frameborder=none style=border:0></iframe>')">Category 1</a><br>
<a href="javascript:void(0);" onclick="hideShow(&#3933;')">Category 2</a><br>
<div id="33" width="100%" style="display:none;"><img src="tn_1_books.gif"></div>
<p id="row22" width="100%" style="display:none;"></p>
<a href="javascript:void(0);" onclick="snapitup('row11','<table id=nTable border=2 width=500 height=400 cellpadding=0 cellspacing=0><tr><td>Data One</td><td>Data Two</td><td>Data Three</td><td><a href=# class=button>More</a></td></tr></table>');">Category 3</a><br>
<div id="row11" width="100%" bgcolor="#b9b9b9" style="display:none;position:absolute;left:100px;top:100px;"></div>
</body>
</html>
</pre>

Ok first the bad, it will not work from a stylesheet, you have to use style="display:none" all over the place, I will try to fix that without adding more than 2 lines to the script somehow, I hope. you can not have line breaks in the innerHtml statements in your links(I think that's normal anyway). javascript:void(0); will not work for an iframe, you have to use #(or #null to keep from clicking up to the top of the page) for the hrefs, I don't know if that is a bad thing or not, there has to be something better than both of those options. now the good, if you do not have access to the head of a page, everything works from the body of a page. it is good for making ul/ol tags for a vertical menu without that complicated scripting having to differentiate ul/ol text and li links in those scripts for just a simple menu, the ecmascriptmenu is the only one that makes sense to me, hope he gets his server fixed. the script seems to work with or without a doctype in IE6 firefox and safari. people always wonder why I try to make these type of scripts, I usually maintain long lists of links so I like to provide small previews(iframes that do not load until clicked) for each link, the best part is that IE firefox and safari react to it flawlessly unlike most other types of scripting, one script had an eval statement that gave me tons of trouble taking it out and the other script I took out a server sql proprietary call to a rowid for a table and made almost any html element be a target(a p tag for instance).
here at :

View 9 Replies View Related

Loading Page That Contains Two IFrames?

Jan 24, 2011

I have a problem because I don't know nothing about Java Scripts. In the [URL] I have load a page that contains two iframes, the first (left) is the menu and the second (right)is the explanation for each one of the menu tabs. No problem so far. The problem is that I need that the menu tab keeps highlighted while you see the relative information on the right side.

View 5 Replies View Related

Loading File From Disk - Select A File From A List And Load It Into A Webpage

Jan 1, 2011

I am looking for a way to select a file from a list and load it into a webpage. The page and the files are stored on a sd-card for off-line usage, I know that listing files remote dynamicly needs a scripting engine but since the sd-card is on the client side that is not possible, but I can make a list of those files when creating them.

It is intended for a datalogger on a tractor-puller, I create csv files with a bash script on the logger and for off-line viewing I use a javascript charting engine which loads the csv file, the files have the creation date as filename and I can make (and maintain) a list of files when creating them. The plan is that the we can select another data set (run) from within the browser and show that one. I have setup an example at [URL]

View 4 Replies View Related

JQuery :: Loading A Php File?

Aug 2, 2011

i need jquery to load for 3 tables from different php files without leaving the page , and table links on the bottom . So , onclick , links will load those external php files without leaving the page . Here;s a example of what i need :D

View 2 Replies View Related

JQuery :: Loading Html From External File Into Div?

Mar 17, 2011

I'm fairly new to jquery so apologies if this is a very simple question with a very simple answer, but I just can't figure out the solution. I have an overlay div, and when I close the overlay I want to remove the html inside it and then re-load it from the specified file. I have already worked out how to empty the div, but what I now want to do is re-populate it with the content from a separate file on my web server.

[Code]...

View 1 Replies View Related

JQuery :: Refresh A Div Without Loading Any External File?

Sep 6, 2011

I was wondering if how could I refresh a div after a successful ajax execution. My code goes something like this:

$("span.save").live('click', function() {
var id = $(this).attr('id');
var name = $('.ingr_name_' +id).val();
var amount = $('.amt_' +id).val();

[Code].....

View 1 Replies View Related

Jquery :: Loading XML/File Into DIV Makes It Fail?

Feb 16, 2009

http://9publishing.co.uk/test/xml/jquery/

The links at the top load XML/file/content into the DIV. This works ok.I then want the images (from 2nd link) draggable to the right hand menu. It doesn't work.However if I select everything, view source code, save the file and view it (http://9publishing.co.uk/ test/ xml /jquery/jj.asp ) it works fine!

P.S. The code that loads the content into the DIV is:

javascript Code:

var xmlHttp
function showCD(str)
{[code].............

View 1 Replies View Related

JQuery :: Point Of Loading The Google Maps Api File?

Apr 28, 2009

Point of loading the google maps api file?

[Code]...

View 1 Replies View Related

JQuery :: Loading From Local File System For Offline Usage

Apr 11, 2010

I'm having an issue getting jQuery to load from a local file system. My head links are:
<script type="text/javascript" src="js/jquery-1.3.2.min"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.scrollTo-min.js"></script>
<script type="text/javascript" src="js/jquery.localscroll-min.js"></script>
<script type="text/javascript" src="shadowbox-3.0.3/shadowbox.js"></script>
<script type="text/javascript" src="js/myscripts.js"></script>

This works fine when served from my server via http. However, I want to load this entire site (including all linked js/css files) from a local filesystem for offline usage. When I move the project to a local filesystem, the browser throws a bunch of errors from the secondary scripts (like jquery-ui) which indicate that the main jQuery lib isn't loading (ie.ReferenceError: Can't find variable: $). This behavior is consistent across IE7/FF3/Safari4Mac.

View 2 Replies View Related

JQuery :: Json Considered The Better File Format For Loading Data Via AJAX?

Aug 14, 2011

Is Json considered the better file format for loadind data via Jquery AJAX? I am going to use it either way, but from a cutting edge stand point, is JSON looked at a more cutting edge since it loads faster. 2. And for that matter is anyone using css3 and E4X? All these seem to require the latest versions of all browsers. Since my goal is to be cutting edge I was thinking to do some stuff in the above listed that require only the latest browser if it is detected, if not use what works in most all browsers? What are cutting edge web app developers really doing at this time?

View 2 Replies View Related

JQuery :: Create A Simple Image Gallery By Loading Images From An Xml File?

Jan 11, 2011

I'm trying to create a simple image gallery by loading images from an xml file The xml file looks like this

Code:

<?xml version="1.0" encoding="UTF-8"?>
<images>
<img>images/01_th.jpg</img>

[code]....

I'm trying to create a simple list of div's like below

Code:

<div>
<img = "images/01_th.jpg" />
</div>

[code]....

View 5 Replies View Related

Loading Xml File

Dec 5, 2007

I use the following to load an xml file...

xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load("file.xml");
xmlDoc.onload=getmessage;

How do I check if it had loaded correctly? I read something about a ready state you can call?

View 2 Replies View Related

Loading Js File Into Cache

Sep 22, 2006

What's the simplest way to fetch a js file from the current website, then
cache it?

I'm using dojo, which has a large js file when using the built version.
As a mercy for dialup users, I want to serve up a tiny 'loader' html page
(containing an animated 'loading...' gif) which, when loaded:

1. retrieves the big js file, and plants it in the cache
2. when the js file is retrieved, then sets document.location to
the url of the real website page which uses this js file, and
thus redirects to that page.

View 2 Replies View Related

Loading XML Into An HTML File?

Sep 8, 2009

I'm currently working on my portfolio website and would like to have information about my movie clips be retrieved from an XML document when a thumbnail is clicked. I am building my website in HTML and would like to retrieve the Xml using JavaScript.

[Code]...

View 1 Replies View Related

Loading XML File Using XMLHttpRequest?

Dec 4, 2009

I'm a newbie trying to modify the code in an AJAX tutorial to load data from an XML file, and it is not working. The code is in a php file that is invoked with the URL:getXMLTest.php?showName=photoShowTest.xml The code I've written (mostly copied from the tutorial, actually) is:

<!Doctype HTML>
<html>
<head>

[code]....

View 8 Replies View Related

Loading A File Into A Textfield

Sep 30, 2002

I am writing a mailing list app in PHP, the thing is I have a folder which will contain templates, is it possible to load the users template selection (say by clicking a radio button) into a textarea or iframe.

View 3 Replies View Related

Loading File With Variable?

Oct 20, 2011

I need to load a file with a javascript variable. I am trying to provide a method for a vertical javascript scroller to be updated by nonprofessionals, so i decided to have the text in a external file that can be updated

<script src="js/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
<SCRIPT LANGUAGE="JavaScript">
//-- Begin Scroller's Parameters and messages -->

[code]....

View 1 Replies View Related

Loading A Xml File From A Form?

Apr 20, 2010

What I mean by this is how do you load an xml document that has been inputted as a string in a form. I would've assumed it was something like this, but this doesn't seem to be working.

<html>
<head>
<script type="text/javascript">
function loadXML(file) {

[code].....

View 1 Replies View Related

Loading A String From An External File

Jul 23, 2005

i was wondering if it is possible to load text into a string from an
external text file. the reason is that i have a very large string and
it is making my script very messy.

also, is it possible to have some dynamic parts of the text from the
text file? for example, if i load in a string and there is a part of
it that inserts a value from a variable like the following:

'The number of people is ' + var_people_num;

....so the text from the external file would load but these parts would
be given the value of a variable contained in the script that calls
the external file. its not absolutely crucial that i obtain this but
it would help me seperate large chunks that complicate the script.

View 1 Replies View Related

Loading A PHP File/code Via Javascript.

Mar 3, 2006

As we all know, JavaScript is client side and php is server side, (the php
code is 'allowed' to do stuff on the server that JavaScript cannot).
The problem with php is that it timeout after a while, (and the user also
has no clue as to what is going on for a long time).

I need to run a script on the server that could take a very long time.

So what I was thinking is mixing both JavaScript and PHP
Something like,

<script>
var endvalue = 1000; /* some number that the server can calculate
quickly */
var i = 0
while (i<=endvalue)
{
/**
call a php file that will do some work
somefunction.php?someNumber=i
*/
}
</script>

That way the server does the work, while the client keeps it going.
Ideally I would also get a return value/string from the php script.

View 9 Replies View Related

Speedup Loading Of File From Another Site?

Jan 27, 2011

I have a JS file on site A which needs a few parameters from a short text file on site B. Since crossing domain boundaries in JS is problematic, the way I do it is that the JS actually opens an intermediate PHP file on site A which redirects to the destination page in site B. Here's how it goes:

The call is made through code...

The problem is that this takes a long time. I would really like to speed this up. For example - I thought of using a direct IP address, so that there won't be any need a DNS server (using
Code...

) but this would expose me to hackers as it would make my Hostgator username visible. According to HG support the above format is the only way to access my subsite via direct IP.

Any ideas on how to speed this up, either by bypassing DNS (but without exposing username) or by offering another way of reading data across sites?

View 5 Replies View Related

Firefox Never Finishes Loading File / Fix It?

May 1, 2009

I'm building a home page with an update checker. A function, called 500 millisecs after the page loads, appends an external .js file and compares a variable on it to a different internal variable. If the internal variable is lower than the external variable, then the update prompt is displayed.

This all works fine, but the status bar says "Read www.primedesigning.com" (the site with the external js), or sometimes "Transferring from www.primedesigning.com". But, if I hover over any link, the status bar goes back to "Done". Also, if I leave my mouse still, wait for the update prompt to appear, and then move the mouse, the status bar says "Done".

I have the Fasterfox extension installed, and it confirms what the status bar is saying. It never stops loading unless I do 1 of the 2 solutions mentioned above.code...

View 4 Replies View Related

Put Some Additional Checks While Loading The File ?

Jun 12, 2009

I want to put some additional checks while loading the file for that I need to check where each line contain the "|" symbol or not which I am using as a file delimeter.Can anyone tell how can we read the file line by line in javascript.

View 3 Replies View Related

Speeding Up Loading Of File From Another Site

Jan 27, 2011

I have a JS file on site A which needs a few parameters from a short text file on site B. Since crossing domain boundaries in JS is problematic, the way I do it is that the JS actually opens an intermediate PHP file on site A which redirects to the destination page in site B. Here's how it goes: The call is made through:

[Code]...

View 1 Replies View Related

Loading A Css File Based On Browser Being Used?

Jul 16, 2011

I have some code that performs differently in Opera than it does in any other browser. So I have a stylesheet specifically for opera. Is there a way to do something like this, where I check the browser, and if it's not opera, then load the default sheet, otherwise load the opera-specific css?

<script>
// Browser Detection Javascript
// copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd
// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.

[Code]....

As of this writing, that code seems to break my page, as if it doesn't like loading a sheet based on an if/else clause.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved