Javascript/ajax auto logout mechanism - JavaScript Help


I have coded a site architecture that creates a file when a client contacts the site. It is created as a php script so values can be retrieved with
include() or require(). My problem is detecting when the client has left the site so the file associated with the client can be deleted, or moved
to an archive.

I have done this with the use of a frameset file that displays all the site content. THe frameset has an unload event hancller and ajax is used
to advise the server that the site has been left. (the idea is that the frameset is loaded as long as the user is in the site, and would only
detect unload if the user navigates out of the site)
But I need access to location field, or bookmark information, and the 'home' button in browsers. I don't know if this is possible. I have been
testing with a simple alert onunload. This alert will not run if I use a bookmark or the 'home' button in Firefox (and I presume that applies
to all or most other browsers. I am aware of the location object, but in the situation, it does not seem to represent what the user has typed
into the location field.

I have done tons of php and javascript; I just need a reference to answers to question about bookmarks and other location related browser
functions.

Otherwise I will have to manually delete accumulated client tracking files-- and wonder which ones represent active clients.
Posted On: Wednesday 2nd of January 2013 12:31:19 AM Total Views:  56
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




Problem in confirmation message in delete or submit??

, I am using one javascript function for confirmation in submitting link in database. As we know there is two option comes for confirmation for YES and NO. But when i am clicking NO button then it is submitting the request . But i want when i click only on YES then it should submit form other wise it returns false. But this is not going.So please help me to solve this. I am sending code which i am using :--
VIEWS ON THIS POST

105

Posted on:

Monday 19th November 2012
View Replies!

tab

I have a number of text boxes with tab index. I want to go through these text boxes on key press. So how can I proceed to next tab indexed element using js Thanx in advance,
VIEWS ON THIS POST

107

Posted on:

Monday 19th November 2012
View Replies!

non-functioning Function - HELP!

Here you have it! I've done a lite modification in your code! Calculate Gas Mileage /* */ Starting mileage: Ending mileage: Gallons used: Miles per gallon:
VIEWS ON THIS POST

116

Posted on:

Monday 19th November 2012
View Replies!

Flash Shoshkele

There is this Flash banner which expands when rolled over ... it falls behind the javascript scroller that is on page... how can the flash banner made on top of the javascript scroller ...
VIEWS ON THIS POST

52

Posted on:

Monday 19th November 2012
View Replies!

Form using AJAX / jQuery to set session with dropdown menu

I believe this question will involve AJAX, jQuery, PHP, and sessions. I've tried for days and can't crack this. Starting fresh after many walks. I simply want a form with a dropdown box that does NOT refresh/reload the screen. Saves the selection as a SESSION and "selects" or highlights the dropdown choice based on the session they just set. So in a nutshell... - Client selects the option (must use onchange event instead of clicking submit) - using jQuery / AJAX this helps to prevent the page from reloading (correct) - dropdown choice is "remembered" because it uses the session to compare and "selects" it. - Also able to echo / print the session on the same page. I'm going to be using this simple example in multiple steps of an ordering form which uses check boxes, radios, input boxes, and dropdown menu. If anyone knows of a simple example using a dropdown box, that would get me started. The attempts I had before would only set a session using the first or last of the dropdown list instead of the one chosen.
VIEWS ON THIS POST

137

Posted on:

Monday 19th November 2012
View Replies!

Addition of elements in an array

I am trying to add the elements in an array together and display the result, I am using a user prompt to obtain the elements for the array, this works fine but when I come to add the elements together and display the result all I get is a row of the elements not their sum. The user inputs are all integers (the program adds the prices of items together so they are all numbers,amounts). If the user enters 10, 15,15,20 the result I get is 10151520 not 60. Can anyone point me in the right direction
VIEWS ON THIS POST

111

Posted on:

Wednesday 21st November 2012
View Replies!

google maps API - place avatar

How can i place a avatar image on google maps showing the position of a person based on latitude and longitude I am using google maps API for it.
VIEWS ON THIS POST

150

Posted on:

Wednesday 21st November 2012
View Replies!

word cloud

So a while ago I wrote a tag cloud program that would take a bunch of words from a text area and make it into a cloud. I'd like to be able to make a word cloud from information on another website and can't find anything helpful on google. Here is my code from the original project. I'm assuming I just need to change something at the top (getelementbyid to getstufffromanotherwebsite). function makeCloud() { var textarea = document.getElementById("tags"); var textarea_string= textarea.value; //grabs text (1) var tag_array=textarea_string.split(" "); //creates array and splits when there is a space (2) tag_array.sort(); //sorts array in lexicographical order //count frequency of tags in array (3) var freq = new Object(); for (var i = 0; i < tag_array.length; i++) { if (!(tag_array[i] in freq)) { freq[tag_array[i]] = 0; } freq[tag_array[i]]++; } var maximum_frequency = findMaxFreq(freq); createDivElement(freq, maximum_frequency); } function findMaxFreq(input_obj) //to find max frequency of words (4) { var max_freq = 0; for (var tag_word in input_obj) { if (input_obj[tag_word] > max_freq) { max_freq = input_obj[tag_word]; } } return max_freq; } function createDivElement(input_obj, max) //creates new div element for tag names (5) { var div_parent = document.createElement("div"); //creates new div element div_parent.style.border = ".1em solid silver"; //sets border to solid silver div_parent.style.backgroundColor="blue"; //sets background to blue div_parent.style.color="silver"; //sets font to silver div_parent.style.font="serif"; //sets font to serif div_parent.style.fontSize="x-large"; //extra large font div_parent.style.width="350px"; for (var tag_word in input_obj) //for all the tags { var word = tag_word; var wordfreq = input_obj[tag_word]; var span_element = document.createElement("span"); //creates new span span_element.setAttribute("class", wordfreq); //sets class attribute to freq var new_font_size = calcFontSize(wordfreq,max); //calculates font size span_element.style.fontSize=new_font_size+"px"; //sets new weighted font size for span var tag_text = document.createTextNode(word+" "); span_element.appendChild(tag_text); //adds text to span div_parent.appendChild(span_element); //adds span to div span_element.onclick = function(){alert(this.innerHTML + ": " + this.getAttribute("class") + " occurrences");}; } //replaces div element in body with new div var body_element = document.body; var old_div = document.body.getElementsByTagName("div")[0]; //there is only one div element body_element.replaceChild(div_parent, old_div); } //create function that calculates font size for a word w/a given freq., max freq. function calcFontSize(frequency, maximum) { //calculates weight by dividing frequency by the max frequency //uses this weight to find a fraction of 20 to add to the standard 15 pt font var weighted_size= Math.floor((frequency/maximum)*20) + 15; return weighted_size; }
VIEWS ON THIS POST

55

Posted on:

Wednesday 21st November 2012
View Replies!

modular javascript

hi i got a little problem i wanna separate definitively the html and javascript exemple this my html page xxx this the text that i wanna get and this the javascript x.js var x=document.getElementById("p"); alert(x); but it doesn't work ... i think i know why : it didn't parse the document yet i've tried to addEventListener("load","myFunction",false); but nothing happend 'd please help me This post has been edited by xmerou: 16 April 2011 - 02:07 PM
VIEWS ON THIS POST

44

Posted on:

Wednesday 21st November 2012
View Replies!

Delete a certain string using indexOf()?

I have been creating a little Javascript game. People buy items and then sell them for a profit. WHen someone buys something, it displays an image of the thing they just purchased (and have previously purchased). I want them to be able to "sell" the item by clicking on the picture. I have the money system set up, but I'm not sure about how to get rid of the picture when the user clicks on it. Is there anyway to get rid of a certain string () when clicked on I'm pretty sure you can use indexOf() somehow to do this, but I'm not exactly sure how. Can anyone help me Thank you in advance.
VIEWS ON THIS POST

146

Posted on:

Wednesday 21st November 2012
View Replies!

compressed prototype file

i have created an image gallery from http://www.lokeshdha...jects/lightbox2 the prototype.js file from this website that i downloaded is quite big i need a compressed version of this prototype.js file i tried searching for few compresses versions but when i use these files i do not get the effect that this plugin creates when an image is clicked please advice where i can get a compressed version so that i can use a small javascript file and also get the gallery effect
VIEWS ON THIS POST

100

Posted on:

Wednesday 21st November 2012
View Replies!

Grab Pasted Text from event

Hi Guys, Is it possible to grab the text that some one just pasted from the clip board. eg.. (pseudo) So if someone pastes from the mouse or CTRL+V in the text box can I grab whatever text came from the clipboard out of the event Don't forget there may already be text in the text box.
VIEWS ON THIS POST

90

Posted on:

Wednesday 21st November 2012
View Replies!

with innerHTML may include a whole html file (this file without

with innerHTML may include a whole html file (this file without tags eg start with tag ...) document.getElementById('DivExample').innerHTML = file.html here; I do NOT want to use request object[I mean Ajax document.getElementById("content").innerHTML = request.responseText; // but simple javascript], well may achive it
VIEWS ON THIS POST

86

Posted on:

Wednesday 21st November 2012
View Replies!

Get text from textarea

What I need to do is create a simple wiki editor. A user will be able to type code and click submit. onclick a new window will appear with the html page that they typed My problem is I am grabbing the textarea by its Id but when it opens the new window it is displaying the Id of the textarea, not the actual information inserted into it. any help is appreciated. thank you function newwin() { document.getElementById('textstr').value; var w = open(""); w.document.write('textstr'); w.document.close(); }
VIEWS ON THIS POST

97

Posted on:

Wednesday 21st November 2012
View Replies!

Insert text into a textbox

I want to add bbcode inserting to my mail page. Here is my script: Pls note, I am only displaying my write mail function. $page = "BBcode Inserter coming soon. Username: ID: Subject: Message: "; Here is a picture of my mail code: Here is the html form source: Username: ID: Subject: Message: Thx. I have looked at several places on google, but found no help.
VIEWS ON THIS POST

117

Posted on:

Wednesday 21st November 2012
View Replies!

Ajax Drop Down Menu

I am trying to incorporate an ajax drop down menu on one page of a site i am making. I managed to get an example to work on its own fine. This is the example Ajax-driven menus #menuDiv1 { color: #222222; background-color: #77CCFF; font-weight: bold; font-family: arial; position: absolute; visibility: hidden; cursor: hand; } #menuDiv2 { color: #222222; background-color: #77CCFF; font-weight: bold; font-family: arial; position: absolute; visibility: hidden; cursor: hand; } #targetDiv { color: #990000; font-size: 36pt; font-weight: bold; font-family: arial; font-style: italic; } var arrayItems; function getData(menu) { var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); } var dataSource = (menu == 1) "items1.txt" : "items2.txt"; if(XMLHttpRequestObject) { XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = function() { if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { show(menu, XMLHttpRequestObject.responseText); } } XMLHttpRequestObject.send(null); } } function show(menu, items) { var data = ""; var loopIndex; arrayItems = items.split(", "); var target; if (arrayItems.length != 0) { for (var loopIndex = 0; loopIndex < arrayItems.length; loopIndex++) { var text = "display(" + loopIndex + ")"; data += "" + arrayItems[loopIndex] + ""; } } data += ""; if(menu == "1"){ target = document.getElementById("menuDiv1"); } if(menu == "2"){ target = document.getElementById("menuDiv2"); } if(target.style.visibility == "hidden"){ target.innerHTML = data; target.style.visibility = "visible"; } } function hide() { var menuDiv1 = document.getElementById("menuDiv1"); if(menuDiv1.style.visibility == "visible"){ menuDiv1.innerHTML = ""; menuDiv1.style.visibility = "hidden"; } var menuDiv2 = document.getElementById("menuDiv2"); if(menuDiv2.style.visibility == "visible"){ menuDiv2.innerHTML = ""; menuDiv2.style.visibility = "hidden"; } } function display(index) { var targetDiv = document.getElementById("targetDiv"); targetDiv.innerHTML = "You selected " + arrayItems[index] + "."; } function check(evt) { var e = new MouseEvent(evt); var target = null; var img; img = document.getElementById("image1"); if((e.x > parseInt(img.style.left)) && (e.y > parseInt(img.style.top)) && (e.x < (parseInt(img.style.left) + parseInt(img.style.width))) && (e.y < (parseInt(img.style.top) + parseInt (img.style.height)))){ getData(1); } img = document.getElementById("image2"); if(e.x > parseInt(img.style.left) && e.y > parseInt(img.style.top) && e.x < (parseInt(img.style.left) + parseInt(img.style.width)) && e.y < (parseInt(img.style.top) + parseInt(img.style.height))){ getData(2); } target = document.getElementById("menuDiv1"); img = document.getElementById("image1"); if (target.style.visibility == "visible"){ if(e.x < parseInt(target.style.left) || e.y < parseInt(img.style.top) || e.x > (parseInt(img.style.left) + parseInt(img.style.width)) || e.y > (parseInt(target.style.top) + parseInt(target.style.height))){ hide(); } } target = document.getElementById("menuDiv2"); img = document.getElementById("image2"); if (target.style.visibility == "visible"){ if(e.x < parseInt(target.style.left) || e.y < parseInt(img.style.top) || e.x > (parseInt(img.style.left) + parseInt(img.style.width)) || e.y > (parseInt(target.style.top) + parseInt(target.style.height))){ hide(); } } } function MouseEvent(e) { if(e) { this.e = e; } else { this.e = window.event; } if(e.pageX) { this.x = e.pageX; } else { this.x = e.clientX; } if(e.pageY) { this.y = e.pageY; } else { this.y = e.clientY; } if(e.target) { this.target = e.target; } else { this.target = e.srcElement; } } Ajax-driven menus So to incorporate it on to the page i have i added the styles to my css page. I then created a .js page named playersload which contains the following // JScript File var arrayItems; function getData(menu) { var XMLHttpRequestObject = false; if (window.XMLHttpRequest) { XMLHttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject) { XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP"); } var dataSource = (menu == 1) "items1.txt" : "items2.txt"; if(XMLHttpRequestObject) { XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = function() { if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) { show(menu, XMLHttpRequestObject.responseText); } } XMLHttpRequestObject.send(null); } } function show(menu, items) { var data = ""; var loopIndex; arrayItems = items.split(", "); var target; if (arrayItems.length != 0) { for (var loopIndex = 0; loopIndex < arrayItems.length; loopIndex++) { var text = "display(" + loopIndex + ")"; data += "" + arrayItems[loopIndex] + ""; } } data += ""; if(menu == "1"){ target = document.getElementById("menuDiv1"); } if(menu == "2"){ target = document.getElementById("menuDiv2"); } if(target.style.visibility == "hidden"){ target.innerHTML = data; target.style.visibility = "visible"; } } function hide() { var menuDiv1 = document.getElementById("menuDiv1"); if(menuDiv1.style.visibility == "visible"){ menuDiv1.innerHTML = ""; menuDiv1.style.visibility = "hidden"; } var menuDiv2 = document.getElementById("menuDiv2"); if(menuDiv2.style.visibility == "visible"){ menuDiv2.innerHTML = ""; menuDiv2.style.visibility = "hidden"; } } function display(index) { var targetDiv = document.getElementById("targetDiv"); targetDiv.innerHTML = "You selected " + arrayItems[index] + "."; } function check(evt) { var e = new MouseEvent(evt); var target = null; var img; img = document.getElementById("image1"); if((e.x > parseInt(img.style.left)) && (e.y > parseInt(img.style.top)) && (e.x < (parseInt(img.style.left) + parseInt(img.style.width))) && (e.y < (parseInt(img.style.top) + parseInt (img.style.height)))){ getData(1); } img = document.getElementById("image2"); if(e.x > parseInt(img.style.left) && e.y > parseInt(img.style.top) && e.x < (parseInt(img.style.left) + parseInt(img.style.width)) && e.y < (parseInt(img.style.top) + parseInt(img.style.height))){ getData(2); } target = document.getElementById("menuDiv1"); img = document.getElementById("image1"); if (target.style.visibility == "visible"){ if(e.x < parseInt(target.style.left) || e.y < parseInt(img.style.top) || e.x > (parseInt(img.style.left) + parseInt(img.style.width)) || e.y > (parseInt(target.style.top) + parseInt(target.style.height))){ hide(); } } target = document.getElementById("menuDiv2"); img = document.getElementById("image2"); if (target.style.visibility == "visible"){ if(e.x < parseInt(target.style.left) || e.y < parseInt(img.style.top) || e.x > (parseInt(img.style.left) + parseInt(img.style.width)) || e.y > (parseInt(target.style.top) + parseInt(target.style.height))){ hide(); } } } function MouseEvent(e) { if(e) { this.e = e; } else { this.e = window.event; } if(e.pageX) { this.x = e.pageX; } else { this.x = e.clientX; } if(e.pageY) { this.y = e.pageY; } else { this.y = e.clientY; } if(e.target) { this.target = e.target; } else { this.target = e.srcElement; } } Finally i edited the page i want to view the content in to the following COYS var timerId = null; var iFrame = null; function heartbeat() { clearTimeout(timerId); timerId = setTimeout(resetconnection, 10000); } function resetconnection() { iFrame.src = "./pushserver2.aspx"; heartbeat(); } function newpicture(newpic, newinfo) { var img = document.getElementById("advertbanner"); var info = document.getElementById("advertinfo"); img.src = newpic; info.innerHTML = newinfo; } function load() { iFrame = document.createElement("iFrame"); iFrame.style.display = "none"; document.body.appendChild(iFrame); resetconnection(); } Home News Players History Links Ajax-driven menus The only page error i get is object expected on the following line: This error also appears in the example and that works fine. The load function is from a seperate js file so can be ignored. I am able to see the images on my page but not the menus that should pop up underneath. Any help is much appreciated. Cheers Jibber4568 This post has been edited by jibber4568: 27 February 2008 - 10:54 AM
VIEWS ON THIS POST

58

Posted on:

Wednesday 21st November 2012
View Replies!

select value from List/Menu loaded by database

I am new to JavaScrit... I need an urgent help from you.. I have designed a form on that i have given three List/Menus. 1. Country 2.State 3.City when the page load i can get the detail of country from the database. after select the country the state will load... I have done that work.. Now., from the state, i have to load city after the selection of State.... My code is: //To take country detail from database ----Select---- // To diplay state according the selection of the county ----Select---- Now I have to take city according to the selection of state..... Please guide me...
VIEWS ON THIS POST

122

Posted on:

Wednesday 21st November 2012
View Replies!

Playing with Node.js

I started playing with node.js yesterday and wipped together a really simple (and buggy) real time collaborative edit. If you want you can play around with it: http://50.56.124.67:8080/ The code is fugly. Didn't really try to make it pretty or efficient. There is a '/help'. When you first go in it will ask you for a password, its 'password'. Editing during playback is probably screwed up, so don't try it and hope someone isn't editing while your playing back. After finals I'll probably rewrite the whole thing.
VIEWS ON THIS POST

119

Posted on:

Thursday 22nd November 2012
View Replies!

Script to enable ActiveX or JavaScript controls

I need a Javascript that will automatically un-block ActiveX or Javascript when the browser opens an HTML file. I need this for a auto-run page for a CD I am publishing (this is not for the internet). I can't find anything on it while searching google. Thank you. This post has been edited by aj32: 19 September 2007 - 04:46 PM
VIEWS ON THIS POST

134

Posted on:

Friday 23rd November 2012
View Replies!

Ajax: need to send form data to another php page(without?

Hi ... Well i do have a mysql query in one php page(php_1) & I want to submit the variables to the query in different php page(php_2) via form action but how am I supposed to do it without redirecting to php_1.. I need is to post the data to the first php page query so that It performs some action over there & thats all... So hoping sumone who knows ajax might helpme out with a sample code or point me in the right direction...
VIEWS ON THIS POST

128

Posted on:

Saturday 24th November 2012
View Replies!

Difficulty: Understanding Scripting

In my quest towards becoming a guru in Web Development led me to start learning Scripting few weeks ago and i started with Javascript there is this video tutorial that i have on my drive which was putting me through, the going was good but i got stuck when some of the examples demonstrated in there did not perform the way it was performing on the Instructor's system, yeah he said it in the tutorials that some of the Jscript codes may not function well in some browsers especially the older browser,he uses Firefox and Internet Explorer on his system while i use IE and Google Chrome on mine. Well the Tutorial is actually old(i think it's 2006), but cos i use IE9 and 5.0Chrome browsers which i believe are newer i expect the codes to run on them. There are some of his examples that did not work on Firefox browser but at least they work on the 4.5IE he was using but to my surprise, despite the 100per cent copy and paste that i was doing for some of his example few of them did not still work properly on my own IE browser; codes like that one that aids text scrolling, onunload method and other few ones. So "Web whizes" help me out on what i need to do to give my scripting experience a jolly ride into becoming a wizard in my Web Development.
VIEWS ON THIS POST

52

Posted on:

Saturday 24th November 2012
View Replies!

Insert combobox's value at specified cursor in WYSIWYG?

I have a WYSIWYG text area and I want to insert combo-box' value at current cursor location of the WYSIWYG text area. I have a simple textarea where the value is inserting on combo-box clicking. But when I do integrate both files, the functionality wont work. I have both scripting files.. template.html --> Where Insert combox's value is inserting successfully.. example/default.html --> WYSIWYG textarea, where Insert combox's value is to be inserted
VIEWS ON THIS POST

93

Posted on:

Saturday 24th November 2012
View Replies!

Urgent help

I dont know what happened my jquery menus are not working at all.......particularly the hover opacity effect is not working.....it was working 2 days ago i dont know what have i messed with.......here is the full page code....... Niaz Memorial Children Hospital $(function() { // set opacity to nill on page load $("ul#menu span").css("opacity","0"); // on mouse over $("ul#menu span").hover(function () { // animate opacity to full $(this).stop().animate({ opacity: 1 }, "slow"); }, // on mouse out function () { // animate opacity to nill $(this).stop().animate({ opacity: 0 }, "slow"); }); }); $(document).ready(function() { $.blockUI({ css: { border: 'none', padding: '15px', backgroundColor: '#FFF', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: .8, color: '#FFFFF' } }); setTimeout($.unblockUI, 1500); }); $(document).ready(function() { $(".bullet li").hover(function(){ $(this).find('span').animate({ opacity: 0 }, 300); $(this).find('a').animate({paddingLeft:"85px"}, 300); },function(){ $(this).find('span').animate({ opacity: 1 }, 300); $(this).find('a').animate({paddingLeft: "70px"}, 300); }); }); $(document).ready(function(){ $("#slider").easySlider({ speed:800, pause:3000, prevId: 'prevBtn', nextId: 'nextBtn', auto: true, continuous: true }); }); $(document).ready(function(){ $("a[rel^='prettyPopin']:eq(0)").prettyPopin({width: 550,followScroll:false}); $("a[rel^='prettyPopin']:eq(1)").prettyPopin({width: 550,followScroll:false}); $("a[rel^='prettyPopin']:eq(2)").prettyPopin({width: 550,followScroll:false}); }); For appointment: +92-55-3856686|3859676|3846888 Our History Our Faculty Our Gallery Our Facilities Website Under construction We are currently working on our Website design. Soon our image gallery and google maps will be uploaded. Latest images and facilities will also be viewed online. Hospital Renovation We have recently enhanced the decoration of our hospital, brought some new furniture and comfortable chair in the waiting lounge for our patients. Other prespective of this renovation is also cleanliness in the hospital.Read more The Niaz Memorial Hospital (Since 1988) was set up to cater to the burgeoning healthcare needs of the people in the region. Conceived as a centre of medical excellence, the hospital is a multi-specialty facility offering state-of-the-art treatment using latest technological developments in the field of healthcare. Open 24 hours, this 50-bed futuristic Pediatric hospital incorporates the most-modern facilities including high equipped Nursery, stat of art pediatric operation theater, ICU (intensive Care Unit) Laboratory and X Rays ranging from routine to special contrast studies, like barium Studies. Another unique facility is the ergy Department, which brings hope to allergic patients facing the burden of Asthma and ergic Rhinitis and other associated diseases. Besides precise diagnosis, the department presents the opportunity to patients to minimize their symptoms or even be cured. The Maternity and Child Care facility, with its modern Labor Rooms and a dedicated operation theatre for emergency Caesarean Section offers excellent care to both mother and baby in a considerate and relaxing environment, during pregnancy and childbirth. We believe in Prevention is better than cure. So we have developed state of art Vaccination units offering world's most modern and best vaccination schedules. Dr.Gulzar Ahmed View Profile Dr.Asim Gulzar View Profile Dr.Qasim Gulzar View Profile A Message from Dr.Gulzar Ahmed Niaz Memorial Hospital has been serving the needs of the children of our region for more than 25 years. We are proud of our history of delivering care that is on the cutting edge of pediatric medicine - and our mission of making this care available to all children. While there are many fine hospitals in Gujranwala, I believe Niaz Memorial is truly one of the finest. Patients consistently rate the quality of care they have received very highly and say that they would use Niaz Memorial Hospital again, should they require services. Thank you for your interest in Niaz Memorial Hospital, and for visiting our Web site. We hope the site provides all of the information you need about our Hospital, and we invite you to contact us if you need further details, or if we can help in any way with decisions about your child's care. It is with great pride that I look to the future of Niaz Memorial Hospital and serving the health care needs of the next generation. Founder & CEO Dr.Gulzar Ahmed Copyrights Reserved 2010 Niaz Memorial Hospital Home | Services | Profile | Contact Us
VIEWS ON THIS POST

119

Posted on:

Saturday 24th November 2012
View Replies!

Question about regex

I have phone area textbox and i want to test it against values like 1111111 or 9999999. I want at least 1 character to be different in this text area(it is exactly 7 characters long) How can i do this in its shortest way
VIEWS ON THIS POST

67

Posted on:

Saturday 24th November 2012
View Replies!

Need Ajax Code

I need Ajax code for Validating a Form.. Please help me..
VIEWS ON THIS POST

49

Posted on:

Saturday 24th November 2012
View Replies!

I can not find solution how to get control of other?

In the first form Default.aspx I have TextBox1 control. How do I get data from TextBox1 into another form Default2.aspx Is there any example on the Internet I have tried in this direction, but not a solution: $ (Function () { $ ('# Btn'). Click (function () { $. Ajax ({ url: "Default.aspx/TextBox1" data: "{}", success: function (html) { $ ("# Results"). Html (html); } }); }); }); Data from TextBox1 I want to here "results" $ ("# results") Please help because I can not find solutions.
VIEWS ON THIS POST

127

Posted on:

Sunday 25th November 2012
View Replies!

Validate javascript array syntax

Ok, after much searching i finally decided to ask. (Newbie to this forum so I apologise if I don't use correct format) I have built an assessment that pulls through X number of questions from a questionbank. The questionbank sits in a single js file whilst the code controlling everything sits in another js file. This is so the users can update the questions without messing around with the code. ( this is client side - cannot run on server) My problem is this: The question bank is in an array and the non-tech people updating it misses the quotes, commas etc needed to keep the structure of the array. I have built a validation function (try catch etc) but if the structure of the array is compromised the system just throws out an error. Questions: 1) Is there an alternative to using a javascript array to allow users to easily update questions without screwing up the system or 2) Is there a way i can validate the array for syntax and alert the user about the error
VIEWS ON THIS POST

128

Posted on:

Sunday 25th November 2012
View Replies!

AJAX Project titles Required

I am doing my final year project. So I need some AJAX project titles. Please send me some if you have!!!!!!!!!
VIEWS ON THIS POST

57

Posted on:

Sunday 25th November 2012
View Replies!

Print button using rollover images

Hi , First post here - so high hopes! I have created a rollover button that I want to use as a print button in DW MX but when I add Javascript print button code it doesn't work on my rollover. Can it be made to work or is it not possible In its single image state it works fine. Help please...
VIEWS ON THIS POST

244

Posted on:

Sunday 25th November 2012
View Replies!

Grade Calculator JavaScript

I need help figuring out how to get a letter grade from this. The code is work that I did on another application now Im changing it to the grade calculator. It was a loan calculator application. It was too hard to start from scratch.
VIEWS ON THIS POST

43

Posted on:

Monday 26th November 2012
View Replies!

how to keep same tab highlighting?

how to keep same tab highlighting after refreshing the page(page is refreshed after the paging link clicked.) /**this is for tab highliting*/ $(document).ready(function(){ var str=location.href.toLowerCase(); $(".navigation li a").each(function() { if (str.indexOf(this.href.toLowerCase()) > -1 ) { $("li.highlight").removeClass("highlight"); $(this).parent().addClass("highlight"); } }); }) /**this is for paging highliting*/ $(document).ready(function(){ var str=location.href.toLowerCase(); $(".paging li a").each(function() { if (str.indexOf(this.href.toLowerCase()) > -1 ) { $("li.highlight").removeClass("highlight"); // i need codes here to addclass "highlight" previously selected tab after page was refreshed $("li.hp").removeClass("hp"); $(this).parent().addClass("hp"); } }); })
VIEWS ON THIS POST

132

Posted on:

Monday 26th November 2012
View Replies!

Two slidedecks with one navigation problem

I have been sitting with this problems for days, I'm not very good with javascript as I am still learning, would really appriciate it if someone could help me. I've got a slidedeck with a number counter which works perfect together, now I'm trying to add another slidedeck without a counter but with the same navigation buttons. with the code I have at the moment it only slides the first slidedeck and not both with the counter. Can someone please look at my code and help me. HTML Entrepreneurs Efficient and Effective delivery of Interactive Documents to mobile phones Entrepreneurship Entrepreneurship is Management Validated Validated Learning Innovation Innovation Accounting Entrepreneurs Efficient and Effective delivery of Interactive Documents to mobile phones Entrepreneurship Entrepreneurship is Management Validated Validated Learning Innovation Innovation Accounting Prev Next Javascript /* * Navigation for the Principles SlideDeck. * This function binds the prev/next commands * to the buttons below the deck. */ var principlesDeckElem = $('#principles_slidedeck_frame dl')[0]; $('#principles_slidedeck_frame .slidedeckNav a').bind('click', function(event){ event.preventDefault(); if( this.href.split("#")[1] == 'prev' ){ if( deckCurrentNumber > 1 ){ principlesDeckDirection = 'backward'; principlesDeck.prev(); } }else if( this.href.split("#")[1] == "next" ){ if( deckCurrentNumber < principlesDeck.slides.length ) { principlesDeckDirection = 'forward'; principlesDeck.next(); } } }); var principlesDeck2Elem = $('#principles_slidedeck_frame2 dl')[0]; $('#principles_slidedeck_frame2 .slidedeckNav a').bind('click', function(event){ event.preventDefault(); if( this.href.split("#")[1] == 'prev' ){ if( deckCurrentNumber2 > 1 ){ principlesDeck2Direction = 'backward'; principlesDeck2.prev(); } }else if( this.href.split("#")[1] == "next" ){ if( deckCurrentNumber2 < principlesDeck2.slides.length ) { principlesDeck2Direction = 'forward'; principlesDeck2.next(); } } }); /* * Setup the numbering for the SlideDeck. * This function generates some spans that populate * the circular number so they can be faded in/out. */ $('.slidedeckNav').show(); if( $('#slidedeck_slide_number').length ){ $('#principles_slidedeck_frame dl.slidedeck dd').each(function(i){ $('#slidedeck_slide_number').append(''+(i+1)+'') }); $('#slidedeck_slide_number div:eq(0)').show(); $('#principles_slidedeck_frame .slidedeckNav a.prev').addClass("disabled"); } $('.slidedeckNav').show(); if( $('#slidedeck_slide_number').length ){ $('#principles_slidedeck_frame2 dl.slidedeck dd').each(function(i){ $('#slidedeck_slide_number').append(''+(i+1)+'') }); $('#slidedeck_slide_number div:eq(0)').show(); $('#principles_slidedeck_frame2 .slidedeckNav a.prev').addClass("disabled"); } var principlesDeck = $('#principles_slidedeck_frame dl').slidedeck({ hideSpines: true, scroll: false, keys: false, speed: 250, before: function(deck){ $('#slidedeck_slide_number div').fadeOut(); if( principlesDeckDirection == 'forward' ){ deckCurrentNumber = (deck.current + 1); $('#slidedeck_slide_number .number-' + deckCurrentNumber).fadeIn(); }else{ deckCurrentNumber = (deck.current - 1); $('#slidedeck_slide_number .number-' + deckCurrentNumber).fadeIn(); } }, complete: function(deck){ $('#principles_slidedeck_frame .slidedeckNav a').removeClass("disabled"); if( deck.current == deck.slides.length ){ $('#principles_slidedeck_frame .slidedeckNav a.next').addClass("disabled"); } if( deck.current == 1 ){ $('#principles_slidedeck_frame .slidedeckNav a.prev').addClass("disabled"); } } }); var principlesDeck2 = $('#principles_slidedeck_frame2 dl').slidedeck({ hideSpines: true, scroll: false, keys: false, speed: 250, before: function(deck2){ $('#slidedeck_slide_number div').fadeOut(); if( principlesDeck2Direction == 'forward' ){ deckCurrentNumber2 = (deck2.current + 1); $('#slidedeck_slide_number .number-' + deckCurrentNumber2).fadeIn(); }else{ deckCurrentNumber2 = (deck2.current - 1); $('#slidedeck_slide_number .number-' + deckCurrentNumber2).fadeIn(); } }, complete: function(deck2){ $('#principles_slidedeck_frame2 .slidedeckNav a').removeClass("disabled"); if( deck2.current == deck2.slides.length ){ $('#principles_slidedeck_frame2 .slidedeckNav a.next').addClass("disabled"); } if( deck2.current == 1 ){ $('#principles_slidedeck_frame2 .slidedeckNav a.prev').addClass("disabled"); } } });
VIEWS ON THIS POST

130

Posted on:

Monday 26th November 2012
View Replies!

onclick and links

So here's my situation, I am using a css styled div as my form submit button. I'm using onclick to submit it which is working all fine and dandy except for one thing, when you hover over it it doesn't make the little hand to show it's a link (it looks like a button so people should know anyway but I'd still like the hand) so I tried adding just a blank but then it stops the form from being submitted. I try adding the onclick to the but it still doesn't work. Is there a way to use the tag to submit my form so the cursor will still display the hand showing that it's a link Here's my code... Login This post has been edited by CodeVillain: 05 September 2010 - 03:10 PM
VIEWS ON THIS POST

85

Posted on:

Monday 26th November 2012
View Replies!

finding the errors in this function

Hi i've been trying this script n i have some questions spell_img = new Image(); spell_img.src = '/images/standard/spellcheck.gif'; spell_img.setAttribute('title',_lang_spellcheck ); function find_text_boxes() { myforms = document.forms; for( i=0;i < myforms.length; i++ ) { textareas = myforms[i].getElementsById('textarea'); for( y=0; y < textareas.length; y++ ) { spelllink = document.createElement('a'); spelllink.setAttribute('href',"java script:spellCheck(" + i + ", '" + textareas[y].name + "')"); spelllink.appendChild( spell_img.cloneNode(true) ); textareaParent = textareas[y].parentNode; textareaParent.insertBefore( spelllink, textareas[y].nextSibling ); } } } i have 2 questions: What r the errors & how can i fix them How many images will this create and where will it place them
VIEWS ON THIS POST

116

Posted on:

Monday 26th November 2012
View Replies!

is it possible to play a sound from an image?

Hi , I was wondering if it's possible to play a sound from.. let's say a .gif by clicking on it. Or even any other way as long as it doesnt take to much space on the site. (im talking a bout a short audioclip, it shouldnt be more then let's say 10-20 seconds.) Ive tried to embed it in HTML but ive got only a good outcome from mozilla firefox and IE while it wouldnt work on Opera/google chrome & safari.... If you know a good way to do it please let me know any help would be apreciated. greets Katsurou p.s sorry if its not the correct forum to post this thread
VIEWS ON THIS POST

102

Posted on:

Monday 26th November 2012
View Replies!

starting javascript

I want to know what would be better to learn java or javascript and what is the difference. Also what would be a good free study manual or program that could help me.
VIEWS ON THIS POST

107

Posted on:

Monday 26th November 2012
View Replies!

Javascript Validation

hi, iam having an application in which i need to validate all the fileds present above a particular field when user clicks on any field present in a page.similar to this link http://my.naukri.com/manager/createa...cp=5424&wExp=N is this possible using javascript. can we use javascript to achieve this functionality. if thru javascript it is possible,can any one send me the code. waiting for u r replies
VIEWS ON THIS POST

47

Posted on:

Monday 26th November 2012
View Replies!

javascript error??????

hi , I got one javascript error which is coming when i am writing javascript code for numeric value. It is showing "Invalid Character" error . Why this error is coming Please tell me the reason of this coming error. So i can solve this problem.
VIEWS ON THIS POST

94

Posted on:

Monday 26th November 2012
View Replies!

navigation on button click

hi, i have a form with 3 radio buttons and one submit button.on clicking submit i want to navigate to page corresponding to the radio button selected.How can i achieve this..
VIEWS ON THIS POST

90

Posted on:

Tuesday 27th November 2012
View Replies!

HELP! With Javascripts Pop-Up Window

Hi - I am currently using a Javascript for a pop up window that enlarges a thumbnail picture. I wish the POP UP window image to be LINKABLE - that is on mouseover of IT, goto a new window URL - Any help would be extremely appreciated!!! My Current URL for this project is: www.webdesign.johnrandazzo.net/portfolio.htm (then mouseover one of the designs to pop up the window in question) CURRENT JAVASCRIPT CODE:
VIEWS ON THIS POST

174

Posted on:

Tuesday 27th November 2012
View Replies!

Skipping OnBeforeUnload event

! I'm facing several problems with OnBeforeUnload event (only in IE). I need to do some actions with a user when he reloads(F5, "Reload" button, Ctrl+R) or closes the page. The Unload event is a good approach here. However, it ...
VIEWS ON THIS POST

125

Posted on:

Tuesday 27th November 2012
View Replies!

fadeout and hide div from iframe (without jquery) - JavaScript Help

Why does this script need alert to work I tested it in Firefox. :confused: function fadeOut(el, frame) { alert("Why this does not work without this alert"); var el = parent.frames[frame].document.getElementById(el); var opacity = 1; (function(){ if (opacity
VIEWS ON THIS POST

287

Posted on:

Tuesday 27th November 2012
View Replies!

Image fade in/out on mouseover/mouseout - JavaScript Help

I have a problem that seems somewhat complicated. I have an simple mouseover/mouseout image swap on my site. What I'd like to have it do, is onmouseover(fade out src image) and onmouseout(fade in src image). I've seen a lot of code for doing swaps and such, but nothing quite like what I'm looking for. Can anyone provide a snippet to get me started or a link to a tutorial(P.S. I hardly know any javascript...I can do mouseovers and that's about it)
VIEWS ON THIS POST

147

Posted on:

Tuesday 27th November 2012
View Replies!

Javascript + Emacs

Hi , After lots of procrastinating I've hacked together an inferior mode for emacs that allows you to run a javascript interpreter from within emacs. I've found it useful for quickly testing code that doesn't require a browser. If you're ...
VIEWS ON THIS POST

77

Posted on:

Friday 30th November 2012
View Replies!

replacing slash with backslash

Good morning, I can't find the way to replace, in a text string, the "/" char with the "\" char. I know that exists an instruction called replace that has the following sintax : mystring = mystring.replace(/oldtext/flags , "newtext") the ...
VIEWS ON THIS POST

55

Posted on:

Friday 30th November 2012
View Replies!

compact function in javascript

there, Why does the function compact not work for me it is a function according to the javascript documentation. The problem is, however; if I add the brackets after it, the browser complains for some reason and it says compact is NOT a function. Also, with the function parseInt, it doesn't take brackets after it. Isn't it a function I thought functions should always have brackets inserted after thier names like java and php. var drinks = ["pepsi", "coke", "juice", null]; println(drinks.compact);
VIEWS ON THIS POST

59

Posted on:

Sunday 2nd December 2012
View Replies!

How can i make infinite scroll and masonry sorting?

, This is my first tumblr theme attemt and this is what i have got so far, the masonry is working on the main page, but when the infinite scroll jquery plugin loads the second page the sorting acts funny, here are the urls Live Url : http://rmlthemer1.tumblr.com Complete Code : http://snippi.com/s/zn2evle This is my first theme attempt and the only issue i am not able to resolve myself is the masonry positioning on infinite scrolling. i would really appreciate if someone could help me out here.
VIEWS ON THIS POST

115

Posted on:

Sunday 23rd December 2012
View Replies!

Making a drop down menuline

I have created a menuline with HTML and CSS and now I want to make it so that when you hover over the link in the list item it drops down revealing more options. Here's my HTML: {{TITLE}} {{FNAME_TOKEN}} Messages Groups My Groups Create Group Forums High School College Professional Off Topic Tools Flash Cards Games More Evaluation High School College Tutoring And here's my CSS: /* nav bar styles */ #mainNav { margin: 0; padding: 0; list-style: none; border-left: 1px dashed white; overflow: hidden; zoom: 1; } #mainNav ul { list-style: none; margin: 0; } #mainNav li { float: left; width: 12em; } #mainNav a { color: #000; font-size: 11px; text-transform: uppercase; text-decoration: none; border: 1px dashed white; border-left: none; padding: 7px 5px; display: block; background-color: #542437; zoom: 1; line-height: 33px; } #mainNav a:hover { color: white; } The menuline is just made by floating the li elements. The tags take up the whole box to. That way, the whole menuline is the link. Not just on the text. Anyway, I have tried doing Javascript which I think should work, but it's not doing anything. menujs.js: $(document).ready(function(){ $('#mainNav li ul').css({ display: "none", left: "auto" }); $('#mainNav li').hover(function() { $(this) .find('ul') .stop(true, true) .slideDown('fast'); }, function() { $(this) .find('ul') .stop(true,true) .fadeOut('fast'); }); }); It's not doing anything at all. The ul inside each drop down is displaying initially and it shouldn't be, AND when I hover over the links nothing happens.
VIEWS ON THIS POST

84

Posted on:

Sunday 23rd December 2012
View Replies!

Onclick not working? - JavaScript Help

Ok here is my form:$sql = "SELECT storage.quantity, items.name, items.image, items.description, items.itemid FROM storage JOIN items USING(itemid) WHERE userid='".$_SESSION['userid']."' ORDER BY items.name LIMIT $offset, $rowsperpage"; $result = mysqli_query($cxn, $sql) or die(mysqli_error($cxn)); $imagecount = 0; $tableOutput = ""; while ($row = mysqli_fetch_assoc($result)) //while there are still results { $imagecount++; $quantity = $row['quantity']; $name = $row['name']; $image = $row['image']; $description = $row['description']; $itemid = $row['itemid']; //Create TD $tableOutput .= "\n"; $tableOutput .= "\n"; $tableOutput .= ""; $tableOutput .= $name."\n"; $tableOutput .= "".$description."\n"; $tableOutput .= "".$quantity."\n"; $tableOutput .= "\n"; $tableOutput .= "Remove 1\n"; $tableOutput .= "Remove \n"; $tableOutput .= "\n"; $tableOutput .= "\n"; } echo "\n"; echo "\n"; echo "\n"; echo "Item\n"; echo "Description\n"; echo "Quantity\n"; echo "Remove\n"; echo "\n"; echo $tableOutput; echo "\n"; echo "\n";Just ignore the PHP part of it. This is going through a while loop as you can see, but the function "removeOne()" and "remove()" has the itemid in the parantheses so the javascript can catch that value.But the problem is, that it's not even catching the function.One of the functions (removeOne) looks like this: $(document).ready(function() { function removeOne(n) { alert("hi"); $.ajax( { type: "GET", url: "storageprocess.phpitemid="+ n, data: "itemid="+ n, success: function() { alert("Item has been moved to inventory."); } }); } }); Just ignore the AJAX part. I put the alert("hi"); in the beginning to see if it's even catching the onclick and it's not. So I don't understand why the onclick isn't preparing the function..Can anyone help me here
VIEWS ON THIS POST

98

Posted on:

Friday 28th December 2012
View Replies!