How To Add Content
Jul 20, 2005I am assembling a muti-page report into one Web page using portions of
other Web pages. I can get one page to display using:
I am assembling a muti-page report into one Web page using portions of
other Web pages. I can get one page to display using:
1) Script Title: Ajax Tabs Content Script (v 2.2) and Featured Content Slider Using jQuery UI
2) Script URL (on DD): [URL]
3) Script URL of Featured Content Slider Using jQuery UI [URL]
4) Script URL of my implementation of both script. [URL]
5) Problem: I've integrated the featured content slider in one of the default content section of the tab menu as you can see on the link on point 4. The slider is working perfectly when until i click on other tab menu and then back tab menu 1. The slider seize to work no more and worst the other featured content slides are appearing below the first one.
I have previously developed two scripts, both of which work really well, however I want to amalgimate them together if possible? My first script loads the content specified into a single div, replacing the content depending on which function is called, it also displays a loading gif during a timeout of 2 seconds. Here is the page:
[Code]...
I'm using JQuery to write content into an otherwise empty iframe like so:
Code:
$('#ifrmID').contents.find('html').html(htmlContent);
The content is coming from an Ajax request. The content gets used more than once on the page for other purposes which is why I don't simply change the iframe src--I have to do an ajax request regardless so I'm trying to avoid multiple calls.
After I load the content, I need modify the height of the iframe so it fits snuggly around the content.
Calculating the height isn't a problem with the exception that it's not always correct and I think it's because the calculation is happening before images have downloaded.
I don't seem to be able to rely on a `load` or `ready` event to delay the calculation. The load event is the only one that tiggers on a change of iframe content, but it doesn't see the new content.
Code:
$('iframe').each(function () {
$(this).load(function () {
alert($(this).contents().find('html').html());
});
});
This will output '<html><body></body></html>' even though I have successfully inserted different content.
Any suggestions on what I'm doing wrong, or if it's possible to do what I want reliably?
Note that a general JS solution will be appreciated as much as a JQuery one.
I use a small piece of JS code to make different elements on the page show/hide when clicking a link, based on id:
function toggle( targetId ){
if (document.getElementById){
target = document.getElementById( targetId );
if (target.style.display == "none"){
target.style.display = "";
} else {
target.style.display = "none";
}
}
}
Then HTML looks like this:
<a href="#" onClick="toggle('news'); return false;">Show/hide news</a>
<div id="news" style="display:none">BlahBlahBlah</div>
This works. Initially the element is hidden (with style="display:none" property of the element), and the script gets its id and changes its display property to "block" when clicking on a link.
But when Javascript in a browser is turned off, the elements to show are all hidden, and there's no way to see the content of the element.
My question: is there a way to hide toggled elements on page load with JS, so that when it's turned off the hidden content is shown?
Most Jquery I have seen 'pushes' the content above or below it up or down the page as it reveals the hidden content, the above example reveals the content over the top without pushing out any other content which is what I am looking for I have tried to take the code and everything works aside from those tabs!! I was hoping somebody has a link to another site that does the same effect
View 1 Replies View RelatedI have content in hidden (invisible) DIV elements on a page that I want to load into another DIV element on same page. I need to replace content currently in a DIV with that coming from another DIV. DIV ontent could be a P element or a P and IMG element.
View 4 Replies View RelatedI have a page with links that use jQuery to load individual pages of content into a main content area. On one of these pages, I want to be able to link to a specific anchor. (ie, when you click the link named "exec" on the main page, it loads the "services" page and then scrolls to the "exec" div.
[Code]...
Everything works beautifully in FF and Opera but in IE, I get an error message saying "top is null or not an object". It's referencing the line where "target_offset.top" is called, but this is legitimate syntax, so I don't understand the problem.
What is the similar in Jquery of :
document.getElementById('toto').innerHTML = document.getElementById('tata').innerHTML;
$('#totoi).contents('#tata');
So is not contents.
I am using xmlhttp.open();xmlhttp.send(); to send a php content to a div. This php content is again using the same method to get php content from a further page.The content of the div, does not seem to be using the css and javascript files defined in the calling pages <head> section.
Javascript file: scripts.js
client.php ----> loads data from: display_client.php
display_client.php ----> loads data from: display_brand.php
[code]...
I am working on a page, which has menus on the left side in one div, that, when clicked should display a proper content on the right side, in another div. Since the content is rather long I have it in a separate file, so I am trying to come up with a function that will replace the right div contect with that external file content. I believe the function i should use looks something like this:
function ReplaceDiv( DivId, NewData )
{
var data_div = document.getElementById( DivId);
if( data_div )
{
data_div.innerHTML = NewData;
}
}
I tried to use this in my page as following: <a href="" onclick="ReplaceDiv(MyDiv, NewDataFile.php )">Menu Item #1</a> But it does not do what I need it to do. The menu link disappears and the right div content stays the same
how can i use .load() or .get() to load external content into div?
i have code below but doesnt work? i dont know what is the problem.
$(document).ready (function(){
$("tabs1").click(function(){
$("content").load("about.php");
});
});
I'm would like to add a light box to a site that has content generated by php. Basically it is a property site and will have a thumbnail image and description. When the user clicks on thumbnail I would like to display a gallery of pictures relevant to the property. Each property will be generated dynamically by php. My question is how do I enter the selector for the gallery into jquery. I am thinking of using Fancy Zoom as you can use hidden elements, as the gallery will be hidden.
View 1 Replies View RelatedI am new to jquery, i've been trying to figure out how to find out what link a user clicks without using id for the <a> tag.
lets say i have the following links
<a href='javascript:void(0)'>Edit</a>
<a href='javascript:void(0)'>Add</a>
[code]....
I am a little confused about this and whether this is an appropriate approach. I have put this together so far. What it does is display a different html page into the IFrame if the person clicks the link. However, this is not what I want to do. What I want to do, is if Windows XP is detected to display load1.html into the Iframe and if Windows Vista is detected to display load2.html into the iframe.
<style type="text/css">
<!--
iframe#ifrm {
[code]....
I'm creating a simple auto updating script based on PHP and using jQuery to set the interval to 1000 miliseconds. It works in FireFox, as the only one I've tested so far, but in Internet Explorer (Version 7 right now, didn't test others) it just freezes and doesn't auto update. Doesn't auto update either if I refresh the page, so something's messed up here.I'm using the same way of auto updating on other things, such as a chat-page - works on those in all browsers, so I'm kinda on a lost track here.
Here's the JavaScript/jQuery:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
[code]....
My goal with a script I am writing is to remove signatures from a forum I am a part of. Some of the people abuse it with half a page of stuff and it's out of control. So here is what the HTML source code for it looks like
<table cellSpacing="1" width="100%" border="0" class="tback" cellPadding="2">
<tr>
<td width="100" class="headcell">Author</td>
<td class="headcell">Topic</td>
</tr>[CODE]...
The very bottom where it has the 'span' tag and it says "SEC Champions" is where the Signatures are located. I want to completely remove that using my script and this is what I have right now
function sigRemove() {
var sigs = document.getElementsByTagName('span');
for (var i = 0; i < sigs.length; i++) {
sigs[i].style.display = 'none';}}
I know it's incomplete but I only want to remove that bottom span tag and everything inside of it and not every span tag on the page.
I wish to get the content inside a td-tag and use with JS operators. This is my source.
<style>
#a {
display : none;
}
</style>
<table>
<tr id="field_id-6">
[Code]...
So I need to indicate x as the number 120. But I can't just write 120 beside x, because 120 will change to a new number.
I want to create several pages (they can be text or html) with basic informatons for css formatting. example:
<div class="appname"
name: this app
<div class="appdetails">
Version: 1.0
[Code]....
I want to be able to save several of these and load them into a web page where they are formatted and displayed.
This needs to be a client side solution so that I can be able to access this offline.
Edit: so far I have tried this but I am not sure about it. <object type="text/html" data="app1.html">
on my website i have a test.php page and link to test.php?test=1 and test.php?test=2
<a href="test.php?test=1">Test 1</a><br>
<a href="test.php?test=2">Test 2</a><br>
what javascript script do i need to tell it what to put on these 2 pages (?test=1 and ?test=2) and where to put the content i want to have on these pages.
IM new to all this but the following code will deter visitors to your site, who have limited knowledge, copying your content. where nothing is 100% it will stop the chancers taking your hard work and using it as their own, I hope.
<script language="JavaScript">
<!--
var popup="Sorry, right-click is disabled.
This Site Copyright ©2002-2003";
function noway(go) {
if (document.all) {
if (event.button == 2) {
alert(popup);
return false;
}
}
if (document.layers) {
if (go.which == 3) {
alert(popup);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=noway;
// --> </script>
<script language="JavaScript1.1">
<!-- var debug = true;
function right(e)
{
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
alert('This Page is fully protected! copyright ©2002-2003');
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
//-->
</script>
I created a forum topic earlier this week looking for a tutorial on creating tabs which, onlclick would load content into a div.
I was referred to dynamicdrives tabbed content script.
Their are 2 problems with this script, that i cannot use it.
1. It isnt XHTML compliant. They are using an attribute called "theme=''" to change the color of the div tab. So im wondering what to do about this, b/c the w3c validator is throwing an error when i use this.
2. I cant figure out a way to keep the content div white, and only change the color of the tabs. The way a tab script should work is the tabs should be able to have their own color, while the content div remains white, so that text is readable. You can only have the tab the same color as the section your main content has to be on, and i dont find this acceptable.
I generate in a js variable some code of tthis kind:
z = '<div id="d1"><div id="d2"><div id="d3"></div><span id="s1"></span></div></div>'
then i write: document.write(z)
obj = document.getElementById('d3')
obj.innerHTML = "some long html content having tags like <h1></h1><h2></h2>"
Then I want to get the height of my 'd3' div. I use obj.offsetHeight with Firefox and it does work, but it Does Not with Internet Explorer. I looked at so many forums and they all say that offsetHeight do find the height, but it's not working in my case. Any ideas why?
I was just wondering if there is a jscript code to jump to the middle (or where my content is) of the page if i click on the link on the same page. if not how would you do it anyways?
View 4 Replies View RelatedIn IE7 only, I have an issue with disappearing elements/styling. First, my h3 header disappears. The space that it occupies is partially there, but not text is visible, nor is the background or the bottom-border assigned to it. In addition, other divs below the h3 are missing their bottom-border. However, spans nested inside of divs missing their bottom border show the border. Lastly all but one the activity divs is missing its background and the one that does show it, the 4th one, only shows it below the "date" span. Here is the HTML:
[Code]...
I have a page with a slideshow which doesn't look too great in IE8 or lower. Is there a way to display different content for these browsers?
View 2 Replies View Related