JQuery :: .load() Method Won't Get Html From A Parent Directory
Feb 20, 2010
I'm trying to use the ajax load() method to load a file from a parent directory, e.g.
$("#divTests").load("../tests.htm");
But that doesn't work. I can load a simple html file from the same directory as my html file or a descendant directory, but not an ancestor directory. Nor can I load from an external server.
I'm doing my testing on my PC and I'm not running a server (apache or otherwise). Just using it as a simple client. Is that possibly the problem? Or is there something else I'm missing? If that is the problem, is there a workaround?
View 2 Replies
ADVERTISEMENT
Feb 17, 2010
I'm trying to use the ajax load() method to load a file from a parent directory, e.g.
$("#divTests").load("../tests.htm");
But that doesn't work. I can load a simple html file from the same directory as my html file or a descendant directory, but not an ancestor directory. Nor can I load from an external server.
Is that just the way it is, or is their a way to accomplish what I'm trying to do?
View 2 Replies
View Related
Feb 13, 2010
The code is supposed to generate this: PS: This is generated by a PHP Function that the Ajax Load Method Calls.
[Code]...
I've been noticing a lot of problems when loading these stuff, Sometimes I have to remake the HTML Tags because its not showing anything. Is there any option? I want it to load EXACTLY how it is, I don't know if this is some kind of protection for bad code, but if it is I would like to disable. But also, this code is really clean. no problem, I don't know.
View 1 Replies
View Related
Oct 5, 2011
a simple "../" doesn't seem to work :(
let me know if there's any information I can provide.
View 10 Replies
View Related
Oct 26, 2009
Is it possible to use $.post() with the php file in parent directory or a completely different directory?
View 1 Replies
View Related
Jul 14, 2010
Is it faster/more beneficial to have two snippets of code be generated by php at 2 different urls and then have a load function for each url? Or have the two snippets on one page, surrounded by id's and then load them that way?
View 1 Replies
View Related
Oct 26, 2010
I would like to make the following playlist dynamic by having it read a folder. code...
View 1 Replies
View Related
Apr 24, 2011
i need javascript code for directory listing in HTML page. i.e index.htm
View 4 Replies
View Related
Jun 22, 2009
I'm loading content with the .load() method. How do i only allow oneclick to the link. I don't want future clicks to keep loading the samecontent.
$(document).ready(function(){
$("#FAQ").click(function(){
$('<div id="faqcontent" />').load("content.htm #faqs" , function(){
[code]....
View 1 Replies
View Related
Dec 7, 2011
in this example: $(el).load('/data_url', function() { alert('loaded') } );
will the alert be called after the html fragment has been loaded into el and all its elements are available to access or is the callback just after the ajax call has finished ?
View 3 Replies
View Related
Apr 9, 2009
I have a question about OOP Javascript...
How can you call a parent method from a child object?
for example...
Am i using the right way of making an object? prototypal vs classical?
View 1 Replies
View Related
Nov 9, 2010
I'm working on a project for work and I'm having some issue trying to distribute to program the smoothes as possible, on idea I had was using Javascript, Im kind of new at this so ill explain to you what Im hoping to do. Basically Im looking for a onload= function when the .hta opens it would get a file from lets say G:\path\path1\path2\file.hta to C:\path\path1\folder So it would take the file and copy past it in another folder from a different directory. If a popup message could popup saying completed
View 6 Replies
View Related
Jun 25, 2011
I use $().load() to place an HTML snippet from the server into a dialog box which i then need to position relative to the size of the element which has just had the HTML loaded into it. When the main HTML page DOM is ready, I hide() the dialog box, and then use fadeIn() to show with various click() events. I have managed to position the dialog box in the centre of the screen given that there is no content loaded.
However, it seems that when I load the new content into the dialog box the new dimensions aren't taken into account untill the next time load() is called.
Is there a way to get the new dimensions of the element before the dialog is shown in order to position it centre screen?
Here is my code:
function showDialogBox(sender) {
var width = $(document).width();
var height = $(document).height();
[Code].....
View 2 Replies
View Related
Oct 18, 2010
Got the following code, which loads some html into a div, then set's the focus to a textbox:
This works fine with 1.4.2, but with 1.4.3 I get an error in jquery-1.4.3.js using Firebug: handler is undefined Line 1797
This happens on line 2 of the code
To me it looks as if the wrong .load method is being called, from the jQuery docs:[url]
Note: The event handling suite also has a method named .load(). Which one is fired depends on the set of arguments passed.
I think the event .load method is being called because line 1797 in jquery-1.4.3.js
if ( handler.handler ) {and comments around it talk about binding events to objects etc.
Can anyone confirm this is the case, or something else is causing the error with 1.4.3
View 8 Replies
View Related
May 12, 2010
I am creating an application that uses as much Object Oriented code as I could (mostly to learn it).
I have an object called 'photo' that contains two Image() objects 'fullImage' and 'thumbnail'. All is fine and dandy, I can read the thumbnail and the full image, and their associated properties just fine.
But what I can't seem to do is make the thumbnail's onclick event refer to one of the object's methods.
Here is a greatly simplified version of the object's code.
Code:
So, the thumbnails div gets populated with the thumbnails fine. But for the life of me, I cannot figure out how to make the onclick call the photo object's "editPhoto" method.
Will the way that I am creating the objects using the same name for each one, result in only the last one created being accessible. If so, do I need to create an array of objects so I can uniquely identify each one?
View 3 Replies
View Related
Oct 13, 2011
I have defined a method in an iframe named as refresh1().In the iframe we are showing records in a table.on clicking a record of table or you can say row a showmodal Dialog object will open which shows the info of clicked record.I want to call refresh1() method onclick of save button whic is defined in modal dialog.I have triedparent.window.dialogArguments.refresh1() but it is not workin.
View 2 Replies
View Related
May 12, 2011
I have a single webpage that contains information on all 50 U.S. states. There are 50 links at the top to jump down to the state you want, and at the bottom of the information for each state a Back to Top link.
I'm making the Back to Top link into something more complex, and it will require three or four lines of code.
So that I don't have to repeat the code 50 times, and create a burden when I need to edit it, I want to place it in a .js file and call it x. Then below the information for each state I'll simply have:
Does calling code from a .js file 50 times slow down the page load? Which method would load faster?
View 3 Replies
View Related
Feb 27, 2011
I tried load method super as smartupdater orPeriodicalUpdater (Prototype). Now the problem is that I have to build a cycle (loop) and each time I have to change the time (that I take from database) so how method (function) can I use to load external code (example load()) modifying continuosly the timeout?
View 1 Replies
View Related
Dec 10, 2010
Is there a way to load more than one html fragment using .load()? That is, I want my homepage to pull in multiple pages of content into the main page so that I can create a one-page site that slides vertically.
An example of what I've got is
$(document).ready(function(){
$('#footer').load('about.html #content');
$('#footer').load('locations.html #content');
$('#footer').load('contact.html #content');
});
Which of course only loads the first about.html page's #content into the #footer of the home page.
View 3 Replies
View Related
Nov 9, 2011
Here is the code, here is loading 11 times the same page, "artsaved.php" when fading out ".userbutton,.menulabel"
$("#articulosg").click(function(e){
Here in other page, doing almost the same is working correctly loading ONE time "spaint.php"
$("#pictures").click(function(e){
Don't know why is working and why is not working at all...
View 2 Replies
View Related
Jun 22, 2009
The following code is working great for all browsers except for Internet Explorer .. I've been investigating and the problem seems to be the html method. How can I change the script for it to work in Internet Explorer also? [code]
View 1 Replies
View Related
Jun 24, 2011
I'm having a problem where the serialize method isn't serializing form elements that are added to the DOM after the page load. Specifically, when the user clicks on a button some elements are displayed in a dialog that are generated from my server and returned via AJAX. I'm converting from Prototype and didn't run into this problem.
View 5 Replies
View Related
Nov 2, 2011
I am creating a job ticket object that will interact with a database. It has to update the database on the fly via AJAX. Within the job ticket object, I have instances of a Component Object. Within the Component Object, I have an instance of an Editor Object. One of the methods of the Editor object is a function to edit some text and when it's submitted, it will update the database. All of that is working fine. My problem is that I need to refresh the screen with the new contents of the database. I have a method in the Component Object that refreshes the screen, but how do I call it from within the Editor Object? I believe it has to be called there because the editor object has a handler for the form submission and the AJAX function. So I'll have to reference a callback function once the AJAX request is handled, but I don't know how to call it.
I know that sounds kind of convoluted, so hopefully, this very simplified code will paint a better picture of what I'm trying to do:
Code:
Now I want to call refreshScreen, but I don't know how:
View 8 Replies
View Related
Jun 15, 2009
I want to post some HTML (contained in a div on the page) data using jQuery using $.ajax() method. But it is not working.
<script language="javascript" type="text/javascript">
function PostHTMLContentTOServer() {
var pageData = document.getElementById
("MainDiv").innerHTML;
[Code]....
View 3 Replies
View Related
Mar 3, 2011
I'm new to jQuery and Javascript overall, I have searched the internet to make use of jQuery instead of the HTML's iframe tag. My problem is links inside a .load file, I want them to refresh the box on the index.php file, not the file itself (in this case the links are in blog.php)
Here's everything I can provide with:
Files:
"index.php"
"blog.php"
In my index.php file I have this script to make my index.php links open the required file in my div box.
"index.php"
<script language="javascript" type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#html").load("blog.php"); // shows the blog.php when I first enter index.php, which I want to have
$(".link_click").click(function(){
$("#html").load($(this).attr("id"));
});
});
</script>
Here's "index.php" link:
<a class="link_click" id="blog.php">Blog</a>
Here's my div box in "index.php" where I show the information within the loaded file:
<div id="html"></div>
All this works, but here's my problem, I have multiple links within "blog.php" which I want to make "index.php" to refresh the "index.php"'s html div. Is there some kind of way to edit the "blog.php"'s script to make it "index.php" the parent or reference?
"blog.php"
<script type="text/javascript">
$(document).ready(function(){
$(".link_click").click(function(){
$("#html").load($(this).attr("id"));
// Need to change this(?) to make it reference the index.php's html div box
});
});
</script>
View 2 Replies
View Related
Dec 21, 2010
I have several comments embedded in my website and I would like to be able to get the ID or the Jquery object refrence of the parent in which they are contained, for example, in the following code I would like to get the ID "container" just by locating the html comment as a string within the page[code]...
View 1 Replies
View Related