JQuery :: Ajax Load Function - Show / Hide Report DIV
Jul 28, 2009
I have a function that uses the ajax load function to post off some parameters and fill a div with the returned content after a db query has been run to create it. This all works fine, however I would like to be able to replace the div with a loading graphic whilst the content
is generated. I assumed this was done by placing the graphic at the start of the function, then using a callback function to remove it and display the actual data once it has been fully generated...
However when I trey to implement this I am getting a strange result in that the callback fires before the content is generated. So my loading graphic disappears and then the content appears sometimes 10 seconds later. How can I ensure the call back only executes once the new content is
ready to be displayed ??
Here's my code ...
function get_report(){
// Hide #report_here div and show loading graphic here ...
$("#report_here").load("/admin/reports/statistics_report/", {
// Parameters sent go here
}, finished()
);
function finished() {
// Hide loading graphic and show #report_here div here ...
}
View 1 Replies
ADVERTISEMENT
Sep 12, 2011
I am trying to hide/show table when hide/show button is pressed
Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.
Code:
View 1 Replies
View Related
Jun 25, 2009
I'm having trouble loading jQuery into SQL Server Reporting Services Report Manager. Since SSRS is a proe-compiles ASPX page, and we are not given the source code, we have little ability to make changes to the interface. If I could add jQuery directly, the progblem would be trivial. However, all we have the ability to modify is an existing Javascript file that is loaded at runtime in the head of each page. I have been able to get this to load relatively reliably using IE 8, but other browsers either don't load it at all, or only on the first pass. Here is the structure that I have in place:
[Code]...
View 1 Replies
View Related
Feb 15, 2011
I have the following code to load some pages into a div using the load function. When I click one of the links though, nothing happens. I have read a couple of books on JQuery and looking at the examples they give, this looks correct so I am at a loss.
[Code]...
View 4 Replies
View Related
Mar 1, 2011
I have a problem hiding elements after ajax respons.
I have a JQuery script:
$(function() {
$(".tab_content").hide();
$("ul.tabs li:first").addClass("active").show();
$(".tab_content:first").show();
[Code]....
onClick event binded on <li> tag with live() works fine. But I need to hide some tags immediately after ajax call. The jquery script is included together with some HTML code in returned HTTPrespons content data. Is it possible to do this without setting css display:none property?
View 2 Replies
View Related
Nov 25, 2009
I am hoping to load a div after the page is loaded, and once it has play all the video this will fade away. Is it possible to do with the power of Javascript? I have a div with an FLV in it
[Code]...
View 4 Replies
View Related
Apr 2, 2006
I am trying to use javascript to hide a div before the page loads. Unfortunately for a brief second I can see the div on the page before the java script hide it. Is there anyway to set the javascript to hide the div before the page completely loads?
<script type="text/javascript" src="prototype.lite.js"></script>
<script type="text/javascript" src="moo.fx.js"></script>
<script type="text/javascript" src="moo.fx.pack.js"></script>
<script type="text/javascript">
var forgotpass = document.getElementsByClassName('forgotpass');
window.onload = function() {
forgotpass = new fx.Combo('forgotpass', {height: true, opacity: true, duration: 500});
// Hide Div
forgotpass.hide();
}
</script>
P.S. I'm using the hide function within the moo.fx.js file found @ http://moofx.mad4milk.net/. If there is an easier way to di by just write the javascript out in the onload function please let me know.
View 3 Replies
View Related
Jun 24, 2010
I have a simple FAQ show/hide function set up however I am having trouble setting up an if clause. My code is:
$(document).ready(function(){
$("dd").hide();
$("dt").click(function(){
$("dd").hide('slow');
$(this).next().slideToggle();
});
});
However, when you click on the same item twice it firstly hides and then reshows it, I need an if statement that basically states;
if "this?!" is visible/shown
Then do nothing
else
$("dd").hide('slow');
$(this).next().slideToggle();
I am unsure of the syntax and can't figure out what property I can trace out to see if the item is being shown or not.
View 4 Replies
View Related
Aug 1, 2011
I am trying to create a simple splash page.
I have 2 divs on the page, div1 has a gif animation in it and div2 is the page content. I want to hide div2 and only show div1 which plays the gif, then after some time div1 fades away and div2 fades up to show the page content.
This is my thought process:
1) On doc ready, hide div2
2) after 3000 fade div1 out
3) fade div2 in
$(document).ready (function(){
$('#div2')hide();
but I dont know how to fade out the div after a time and fade in the other div.
The examples I see all use the click function.
View 1 Replies
View Related
Jun 23, 2011
I need to see if I can shorten this AND see if I can have a "show all option" added.The page is setup like so.. I have the following javascript working.. I'm running jquery... being a semi newbie it took a while to get this running.I have 4 DISTINCT queries that load up select boxes.There are 4 select boxes .. on change, the queries will see what option was selected and re-run DISTINCT SQL queries so all the select boxes only have related info.. so no one ends up with a "zero" results.I'm hiding these to help walk through in a logical order. However I need to1) Have a show all and let them select anything they wish and show all 4 boxes. How can I add a "show all" to the script below2) I noticed on page load the boxes show and then slowly hide. THis looks messy.. how can I alter that?3) This seems long for what I'm doing.. is there a way I can shorten this code? What if I expand to 8 boxes.. then I'll have 8 simple if statements.. but it seems unnecessary.CODE that is working is
$(document).ready(function () {
if ($("#pMaterial option").is(":selected"))
{
[code].....
View 1 Replies
View Related
May 21, 2010
Anyway, I am using some code that someone else wrote so I claim no credit here for the code.It works great and I've managed to persuade to work in Wordpress but I have one thing I would like to change.Basically the text I am trying to toggle is "shown" on page load - I would like it to be "hidden" until the user clicks on the link to make it appear.Here's the code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-
[code]....
View 2 Replies
View Related
Jan 7, 2011
I have a table that Im hiding during the initial load that has a considerable amount of data. (I dont design'em, I just code 'em).
During the .show, .hide ... functions I would like to display a please wait msg. But I cant seem to find a way to do an async function. As the callback functions only deal with sync ...(I think)
View 1 Replies
View Related
Sep 10, 2005
I have a PHP application that allows users to generate a .pdf report of
their database content. Normally, I've had to refresh a page to call
the script to generate the report, so there's a second or so when the
browser goes blank. I was wondering if it was possible to use AJAX to
call the script to generate the report, then begin the download without
refreshing the page (or in the case of I.E., leaving me with a blank
window that you have to back out of).
The following code 'works', in that it inserts the pdf code in the
textarea, but I'd want to force the browser to start a file download
without refreshing the page.
BTW, I'm using the Prototype 1.3.1 library.
<script>
function searchSales(rptID)
{
//generates the report
var url = 'http://192.168.1.128/sendReport.php'
var pars = 'rptID=' + rptID;
var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars,
onComplete: showResponse} );
}
function showResponse(originalRequest)
{
//put returned XML in the textarea
$('result').value = originalRequest.responseText;
}
</script>
<a href="#" onclick="javascript:searchSales(��')">Click</a>
<textarea id=result cols=60 rows=10 ></textarea>
View 4 Replies
View Related
Mar 5, 2011
just started using jQuery,and i'm having a problem using the function .show()/.hide() to make a div appear and disapear when a certain option value is selected.It's working fine in firefox but not working at all in chrome and IE 8.This is the function code i'm using :
$(function(){
$("#produtos").click(function(){
$("#produtos_valor").show("slow");
[code]....
View 3 Replies
View Related
Nov 9, 2005
I need an 'unobstrusive DOM' function which will show and hide a piece of text within the DIV activated by links. Can anyone help me find a suitable function?
<div id="formatting">
<h3>Formatting options</h3>
<dl>
<dt>Bold</dt>
<dd>[b]text[eb]</dd>
<dt>Italic</dt>
<dd>[i]text[ei]</dd>
<dt>Link</dt>
<dd>link [l=url]text[el]</dd>
<dt>Line break</dt>
<dd>single new line</dd>
<dt>Paragraph</dt>
<dd>double new line</dd>
</dl>
<a href="">Show</a>
<a href="">Hide</a>
</div>
View 24 Replies
View Related
Jul 4, 2011
give me a dive hide show javascript function.
View 1 Replies
View Related
Sep 16, 2009
I am building a large registration form. In this form, a sponsor/educator must register himself or herself and then may add up to 6 more " delegates" in pairs. The first two pairs registration info on the form is shown by default. I need to hide the other two pairs until when/if the user clicks on a button to add two more delegates at a time. I used javascript to show or hide the parts of the form that I had put into two divs and adjusted the css display attribute. However, my problem was that, if the user filled out the sponsor/educator section and the first two delegates, and then decided to add two more, when the user clicked on the button to show the part of the form for delegates 3 and 4, it reset all the previous visible form fields to empty. Not good. So, I thought, maybe AJAX.
I created the request object (I am a relative novice at AJAX), had it grab a text file with the code to insert into my target div, in this case a div with id = "delegate3and4". Surprisingly however, it still reset the previous form fields to empty. Am I misunderstanding how AJAX is supposed to work? I figured that, because it does not refresh the page that this would not happen. In fact, to test this out, I created a simple page from scratch with just a single input field and then used AJAX to insert the file in a div after this field and it did not reset the previous input. So, I am totally confused about why this would be happening on my live page. The page is a php page as it submits the form to a php script for processing but I don't think this should make a difference.
View 3 Replies
View Related
Feb 19, 2011
This is the Javascript function that I use to hide/show DIV content. I use it everywhere without problems:
[Code]...
However, I get strange behavior when the above DIV is located within an AJAX response. My main page loads another HTML page into a div, and within THAT div is the "div6" above.
[Code]...
View 3 Replies
View Related
Jan 8, 2003
The below is a menu, which is hidden until clicked, and can be hidden by clicking it again.
<!-- This goes in the HEAD of the html file -->
<script language="javascript">
<!--
function showIt() {
if (document.layers) {document.layers["layer1"].visibility='hide'}
else {document.all["layer1"].style.visibility='hidden'}
}
function hideIt() {
if (document.layers) {document.layers["layer1"].visibility='show'}
else {document.all["layer1"].style.visibility='visible'}
}
// -->
</script>
<style>
input {border-style: ridge;}
a:hover {text-decoration: underline}
</style>
</head>
<body>
<span id="layer" style="position:absolute; top:17; left:20; width:250; height:90; visibility:show">
<script>
<!-- author: bfsog@hotmail.com use it as you wish //-->
<!--
function buttonText(type) {
if (type=="Hide Menu ") {document.menu.button.value="Menu";}
else {document.menu.button.value="Hide Menu ";}
showIt();
if (document.menu.button.value=="Hide Menu ") {hideIt();}
}
// -->
<!-- change the value of 'top' and 'left' in the layers properties below to place the menu
in the desired position matching the placement of the button -->
</script>
<form name="menu">
<input type="button" name="button" onClick="buttonText(value);" value="Show Menu" />
</form>
</span>
<div id="layer1" style="position:absolute; top:40; left:20; width:250; height:90; visibility:hidden">
<table bgcolor="yellow" border="1" cellpadding="2" cellspacing="0">
<tr><td><a href="http://www.google.com" style="text-decoration: none"><font face="arial" size="1"><b>google</b></font></a></td></tr>
<tr><td><a href="http://www.hotmail.com" style="text-decoration: none"><font face="arial" size="1"><b>hotmail</b></font></a></td></tr>
</table>
</div>
</body>
View 1 Replies
View Related
Aug 6, 2009
I have a script to show and hide various divs based on a function & var. The problem I am having is that when ANY of the variables ('hate', 'ok' and 'love') are passed all 3 different feedback forms ('FeedbackHate', 'FeedbackOk' and 'FeedbackLove') appear, not just the one I want.
Here is the JS:
function sitesurveyswitch(emotion) {
var e = emotion;
document.getElementById('site_survey_hate').style.backgroundPosition = '0px 0px';
document.getElementById('site_survey_ok').style.backgroundPosition = '0px 0px';
document.getElementById('site_survey_love').style.backgroundPosition = '0px 0px';
document.getElementById('FeedbackHate').style.display = 'none';
document.getElementById('FeedbackOk').style.display = 'none';
document.getElementById('FeedbackLove').style.display = 'none';
if (e == 'hate')
document.getElementById('site_survey_hate').style.backgroundPosition = '-80px 0px';
document.getElementById('FeedbackHate').style.display = 'block';
if (e == 'ok')
document.getElementById('site_survey_ok').style.backgroundPosition = '-80px 0px';
document.getElementById('FeedbackOk').style.display = 'block';
if (e == 'love')
document.getElementById('site_survey_love').style.backgroundPosition = '-80px 0px';
document.getElementById('FeedbackLove').style.display = 'block';
}
And here is the code related to this function:
<div id="siteSurveyBox">
<span id="site_survey_hate" onclick="sitesurveyswitch('hate');return false;"></span>
<span id="site_survey_ok" onclick="sitesurveyswitch('ok');return false;"></span>
<span id="site_survey_love" onclick="sitesurveyswitch('love');return false;"></span>
</div>
<div id="FeedbackHate" style="display:none; margin-top:-28px;">
FEEDBACK FORM IS HERE
</div>
<div id="FeedbackOk" style="display:none; margin-top:-28px;">
FEEDBACK FORM IS HERE
</div>
<div id="FeedbackLove" style="display:none; margin-top:-28px;">
FEEDBACK FORM IS HERE
</div>
View 2 Replies
View Related
Mar 20, 2010
I am very new to javascript and html. I am trying to create a function which will hide or show a div (div1). Right now, it is always showing the div whether the boolean value is true or false. I know that it is getting inside the else if part, but it doesn't seem to be working.
<script type="text/javascript">
function hideDiv(flag){
if (flag == false){
document.getElementById('div1').style.visibility="visible";
}else if (flag == true){
document.getElementById(div1).style.visibility="hidden";
}}
var bool = new Boolean(true)
hideDiv(bool);
</script><body>
<div id="div1">
Text!
</div></body>
View 4 Replies
View Related
Jul 5, 2010
if i am using jquery's $.ajax to load content and the content in the url ('test.php')
is <script type="text/javascript">function test() {alert('test called');
}
</script>
how do i get the function test() to execute?as if i call it (from the parent page in the success function)i get told it is undefined
View 5 Replies
View Related
Jul 19, 2009
So in the past I've mostly just copy and pasted other JavaScript functions I needed, and made slight modifications based on my exact needs. However, this time I couldn't find anything that would work with what I wanted to do (show and hide comments on news stories in a particular way), so I decided to just make my own.After a few hours of messing around with it, I'm quite exasperated, because what I have looks like it should work, but for some reason I can't identify, doesn't.Essentially what it should do is, find the table with the ID of the news article whose comments are being toggled, then find all the rows in the table that are labeled as comments, and either show them or hide them, based on their current state (as defined by their class with a "display: none;" in it or not).
Obviously it uses PHP, but I know that's not the problem; it just uses the article's ID number to pass on which comments need to be hidden/shown to the function.From everything I've looked up, this should work, but doesn't. Something peculiar, though, is that the function looks like it's not even being called; I put a simple alert('Test'); in the function, and still nothing happened when I clicked the link. So maybe my function is fine in itself, but I'm just calling it in an incorrect manner?
View 4 Replies
View Related
Feb 2, 2011
Getting my show/hide function to work in all browsers.
The function below works everywhere but Firefox.
Can someone see why it's not working?
My javascript function:
View 6 Replies
View Related
Mar 22, 2010
I'm learning how to use Javascripts and using Prototype framework by following a step by step tutorial from a book. Unfortunately when I stepping through the following code:[code]
View 8 Replies
View Related
Jun 26, 2009
My code looks like this:
$('#edit' .postcontent').load('admin-ajax.php', {'action':'qe-
getpost'});
Everything works great - the returned value is loaded into .postcontent perfectly. However, a 0 is appended to the end. Every time. Even if I return nothing, a lonely 0 shows up inside .postcontent.
View 1 Replies
View Related