I'm trying to create/find a script that will do the following: -load a css file regardless of any conditions. -do not load the css file if a certain text is present in a specified html div tag.
i know this is done with a if/else state like this:
if (condition)
{
code to be executed if condition is true
[Code].....
how to add the condition for the variable text and to specify the css file.
I want the javascript to ignore loading the css if a div tag like this: <div class="menu-opener"><a class="gwt-Anchor" href="javascript:">Text1<img src=..//img.jpg"></a> /div>contains the word Text1, or any other I specify. Else, if any other text inside the div, the css should load normally.
I have been studying php for a while now and i know that, i am now starting php oop and that going well but i have never done anything like this. Anway i am creating a booking system which at the end of the process asks who supplied your voucher which they then select a supplier.
The issue i have is my client wants it so if groupon is selected then an input text box should appear so that the user can input a security code from groupon.
I'm setting up an application that involves blog posts with comments boxes appended to the div that contains the posts. The comments boxes are in iframes and load an html file on the same domain. There are multiple posts/boxes on each page. I need a javascript that will only run the append script when the posts are written and appear on the page. So in non js language, I'm looking for this:
if div id post#5 appears on the page, show the iframe that contains the comments box that goes with post number 5. else don't show it.
our requirement is client wants to know howmany users leaving the main page without entering data in the application page.at that time we need to show the css popup overlay.in the following scenarios overlay should pop up.1)when user leaves the page.(e.g. type other address in the address bar).bascially user shy away from the browser.2)clicks browser close button.we will show one css popup overlay(not browser popup) and in the back ground main application will be greyed out.this overlay consists of some text fields and some buttons will be there and parallely in the back ground we will execute AJAX call.can we accomplish this requirement??is yes how?will it work in all browsers?my concern is how to prevent the browser from closing when css overlay comes up?
our requirement is client wants to know howmany users leaving the main page without entering data in the application page.at that time we need to show the css popup overlay. in the following scenarios overlay should pop up. 1)when user leaves the page.(e.g. type other address in the address bar).bascially user shy away from the browser. 2)clicks browser close button.
we will show one css popup overlay(not browser popup) and in the back ground main application will be greyed out.this overlay consists of some text fields and some buttons will be there and parallely in the back ground we will execute AJAX call. can we accomplish this requirement??is yes how?will it work in all browsers?my concern is how to prevent the browser from closing when css overlay comes up?
our requirement is client wants to know howmany users leaving the main page without entering data in the application page.at that time we need to show the css popup overlay. in the following scenarios overlay should pop up.
1)when user leaves the page.(e.g. type other address in the address bar).bascially user shy away from the browser.
2)clicks browser close button.
we will show one css popup overlay(not browser popup) and in the back ground main application will be greyed out.this overlay consists of some text fields and some buttons will be there and parallely in the back ground we will execute AJAX call. can we accomplish this requirement??is yes how?will it work in all browsers? how to prevent the browser from closing(e.g.when user chooses browser X button) when css overlay comes up.
I have a frame in which there are 2 IFrames., both being loaded from the same domain. One IFrame is loaded from http://test1.xyz.com and the other IFrame is loaded from https://test1.xyz.com/test
I am getting an error while accessing data in the HTTP IFRAME from the HTTPS IFRAME.
Is it possible at all to access the data in the other IFrame, when the protocol is different?
Here as there is no link specified it will open a blank page. guys can u please tell me how can i write a condition so that if my href is blank then it will not open any page. the click should not work or else it should load the same page.
There is a website based game I would like to build, but I am not sure that the main functionality would be possible to program. I have tried to do as much research as possible. I know that javascript can do drag and drop, but would it be possible for the user to specify which images (out of a catalogue of thousands) they would like to be present on screen/toplay with?
It would need to work like this: The user is presented with a catalgoue of images. They can refine this catalogue according to things like colour, type etc. The user chooses which images they would like to play with by adding them to their personal choices (e.g. with an 'add this item' button). In the next step the user is taken to a page showing all the items added to their personal list, which they can then drag and drop around the screen. The user can then save/share their 'creation'.
I have a single javascript file that contains all of my javascript functions. Each of the these functions are particular to different pages on my entire site. How can I create logic that will only allow those functions to work when certain elements or identifiers are present on a page?
I'm working on a webpage which is completely self-sufficient. This means if you copied the source you would be able to load it locally without any glitches from your computer. I want to embed a "Save As" feature into this document using only javascript or jquery. For various reasons I do not have access to a server-side language to perform this action. I've done some research but can't seem to find a definitive way to do this.
My goal: User clicks "Save As HTML" button which triggers jquery to copy the source of the page and present it to the user as a mypage.html download. My fall back approach will be to open a new tab with just the desired html and instruct the user to manually "File -> Save As". However, this is very undesirable and I would like to find a solution to fulfill the goal above.
I am currently trying to use Javascript to dynamically resize a navigation div (that is present on every page) according to the size of the main content div.
I am currently using the following code;
Code:
This works the first time I go to the site and if I refresh a page. However, if I use my on site navigation to switch between pages the div simply uses the height variable defined within my CSS (this needs to be here for users with JS disabled)
Does anybody have any ideas on what the problem might be. It's as if the script is only executed the first time any page on the site is loaded, but then not again.
I have a text box in the page, by select a date and click on button javascript send a Ajax to a php file and run a query and respond which is a number load on that text box, now i need with change of this text box which Ajax change that not user, another function get start. but unfortunately this not work
I have a text field that is for a number. On page load the value is "0.0000"... I want the text field to be blank if the value is indeed "0.0000". Any suggestions on how I can validate and set the value of the text field on page load?
I have grabbed all the links in an array and tried bubble sorting them alphabetically. The first two things I noticed was the " " which I can eliminate but I use Firebug as my debugger and it reports whitespace as whitespace. I do use a lot of  's in the HTML so it may be these that cause the results to show "undefined". I tried removing "undefined" and got a null instead. I tried removing the null and got undefined.
As I am looking at the ".text" property and Firebug probably shows  as whitespace , maybe I should look for  and possibly use ".innerHTML" instead. All I need is to remove leading, trailing & multiple spaces.
because of the security settings in browsers i can't set the default path value of a file upload field in a form. i was wondering if there is a way to have javascript type one in when the page loads?
I have an unordered list (ul#garment_selector) sitting in a div (div#program_scroller) and each of the list items has a link that I'd like to display an image and some text into a div on the same page. I don't want any fancy animations or anything like that, I just need to display an image and a related description/price into a new div, preferably without reloading. I have quite a few different lists of links and they change all the time so using an array to define the image/text is impractical for my needs.
I have a character countdown that tell you how many characters you have type in the text area. But I am having a problem, I can't see to show a text or the number the character the user when I load the page. I want it to show Characters Type: 0 when you load the page, and not having to press a key to show it, here is the code I am using...
I have a text file that contains a whole bunch of data points neatly formatted (it's basically a CSV file). I need to create a quick JS function that would load the CSV file (from a URL) and display it with in a page. No parsing is needed! I just need to suck down the file and insert/display it within two div tags.