I was just wondering if there is a way to load a CSS file depending on the browser that you are using. In this case I am looking to load a CSS file for Safari only. maybe another option would be to use CSS hacks (but not webkit).
If I had a webpage that displayed a database in tabular form, it would be nice to know how many lines of text the browser could display without scrolling, then have the cgi script output the appropriate number of lines of data to fill the screen.
I've seen examples of how to get the browser window size in pixels, but is there a way to determine the number of lines that are displayed?
I have a floating div that stays at the bottom of the browser window while the user scrolls down a long page. The div reads "scroll down for more". How can I determine the current position of the div in relation to the top of the page, not the top of the browser window. I need to determine this because I would like to hide the div when the user scrolls to the top of the last page. I have looked at offsetParent, offsetHeight, scrollHeight, etc.
I have the code for everything except determining the position of the div, or the distance of the div from the top of the page.
I have a floating div that stays at the bottom of the browser window while the user scrolls down a long page. The div reads "scroll down for more". How can I determine the current position of the div in relation to the top of the page, not the top of the browser window. I need to determine this because I would like to hide the div when the user scrolls to the top of the last page. I have looked at offsetParent, offsetHeight, scrollHeight, etc.
I have the code for everything except determining the position of the div, or the distance of the div from the top of the page.
All my font-sizes are set as relative sizes in CSS (large, medium, small, x-small, etc). Let's say something is set in CSS to be xx-large, but a visually impaired user wants it displayed even bigger. Can a script determine an element's absolute size, *as it is being rendered by the browser*, and then increment the element's font-size in absolute terms?
I need to be able to ensure that an html page will always load up in a particular browser. Let's say IE.Changing the default browser settings in the registry is horribly complex, and, besides, I don't want to override the user.That is, I envisage a javascript function on page load that checks which is the default browser in the user's machine. If it is IE, fine - page loads normally; if not IE, the page somehow forces a load in IE.I realise that you can make shortcuts that load up IE first and then a particular page, but that method has shortcomings: specifically the shortcut target below won't work in Windows 64-bit (and I must have a single shortcut for this task - not one for each Windows version)."C:Program FilesInternet Exploreriexplore.exe" -k "C:Program FilesmyfolderREADME.html"
I am building a webpage that loads information from an XML file. I am using XMLHTTPrequests.
On page load a function populateH(); is called which reads the XML file and populates the HTML(Home) page accordingly. The function uses getData() functions to read and write from the XML file.
The page works properly in FireFox, but the populateH() function doesn't seem to work with other browsers. I have tested my getData() functions in other browsers and it seems to work fine.
(example available at: [url]
My get data function is written as follows:
Code:
And my populateH() function is written as follows:
Code:
I use the XMLHttpRequestObject in the populateH() function to set the nodes to retrieve, and the getData() functions are called in the place functions (placeNews(), placeFriends(), placeLinks()) to write to the HTML document.
I have swf, I want to resize it to fit browser window. So, that is width is always 100%, and height is proportional to width. I do <body onLoad = {} function, get browser window width there, calculate new height: height = width/2.70 But, how can I now apply it to my swf file? Like, i set its "id" to my "flash" (<embed src="final.swf" id = "flashme" ) to pass it to the function, but I do not know how to alter params
On a page, I have a javascript json output that is generated through PHP. So, for instance, it would look like this:
Code: var upny_iniresults = { // "q_id" : "65977", // "q_txt" : "What is your favorite genre of Music?", "q_cdata" : [
And then PHP code that generates the JSON. I loop through a question, scan for the results (survey site) and display it as json data. Works perfectly. Basically, the JSON is important because I have existing functions that work with that data (display survey results of that question/etc)Here's the question.How can I generate the same Json output, so it can be read by my other jquery functions (Created by a previous developer, I am a PHP guy) by using Jquery POST as well as a query string. The idea is something like:
Code: $.post("create_json_results_for_this_question.php", $("#firstform").serialize()); # Firstform is the name of the form that is submitted.
So, would a jquery POST allow the JSON to load in my browser (which I will activate during a click function) just as my PHP json output works or is there another way? I just want to simulate the same effect, but be able to USE the jquery querystring that I have, which is:
$("#firstform").serialize());
because this lets me return survey results of a previously submitted question.My last q. was too convoluted and I realized my dilemma is just the json output.
My prob is that the huge amount of data (15MB of XML) that is loaded by an AJAX call, literally locks the browser while loading it into the DOM. Does any of you know if there is a way to prevent that. Btw - As you see I use jQuery and the ajaxManager plugin.
How you handle back button scenario in firefox browser. The problem is when i click browser back button , the javascript on load is not executed and page is rendered from cache.
Another thing that has been driving me crazy is that css positioning is handled differently by different browsers. JS is not my area, but I can do a lot with CSS, and I do, but cross browser compatibility is killing me.
I can use an IF IE statement and only IE runs that segment of code, but I haven't been able to figure out out how to make ONLY firefox or ONLY opera or safari enact an encapsulated segment of code. The same type of IF statement doesn't work for them.
Is there a single method using JS that works for all browsers?
I have a frame's onload event calling a function which needs to know which file was loaded. Is there any java object/method to determine the file name or any type of file id?
I know it's possible to retrieve the IP address of a visitor's computer. However, I need to figure out a way to get the IP address of the server where the files are placed. Here's a description of my issue:
My application, along with some HTML Electronic manuals, are loaded onto a server in an electronic classroom. In order to get to any of these items (manuals or app), the students access the server where an index page is located in the D drive and click a link to get to any of them.
The problem is that these manuals are loaded into the D: drive while my application, because it uses ASP, is saved in the C:inetpubwwwroot folder.
The other issue is that this application will not be placed in just one classroom. Each classroom will have its own server with any number of computers accessing it. Since I don't know how each of the servers will be set up, I need to get the IP address so I can access the wwwroot folder.
What I need to do is figure out, using some non-server-side language, what the IP address or computer name of the server is so that I can access the appropriate folder in the wwwroot folder.
This should be an easy one. I am using a single OnChange event with several <Select> statements, and need to identify the specific <Select> control that fired off the onchange event. I'm certain there must be a way to grab the ID or Name from the specific control in the javascript function, but I haven't been able to find it.
My spidey senses are telling me this can't be done without making an additional [XMLHttp] request, but ... Any way to read the redirected URL for an image? Suppose I have the following tag: HTML Code: <img src='/images/test.jpg' /> And suppose the image request redirects to /images/test.jpg?token=123. The image src, according to JavaScript is still /images/test.jpg. Any way to determine the new URL? (short of making an AJAX request for the image and reading the response header?)
Is there anyway to determine if a DIV with its overflow style set to auto has the scrollbars visible? I have a dynamically built table inside my DIV. If the table is over a certain height and the scrollbars appear, I want to shrink the width of my table. If the table's height doesn't exceed the div's height, I want the table to be the same width as the div. Any ideas?
I have a script that will set the focus to a particular input box. I want the script to check to see if the input box exist also.
I'm receiving the following error: 'document.ScheduleForm.txtGrossPayroll99' is null or not an object.
The txtGrossPayroll99 is a field that does not exist. I've hard-coded this name into the script to see if it is working correctly. I'm using the OnLoad event inside the <Body> tag to execute this function.
var formInUse = false; function setFocus() { if ((!formInUse) && (typeof(document.ScheduleForm.txtGrossPayroll99) != "undefined") && (typeof(document.ScheduleForm.txtGrossPayroll99) != null) );{ document.ScheduleForm.txtGrossPayroll99.focus(); }}
I have a script that I want to run only when my input box IS NOT disabled. Can someone tell me if something is wrong with my script? Is "disabled" the correct property to use?
function TextChanged(i){ if (!document.ScheduleForm["txtGrossPayroll" + i].disabled) { document.ScheduleForm.txtRecordStatus.value = "Changes Made; Record Not Saved.";
I am writing a greasemonkey script and I can capture the click event. What I want to know is how do I determine that the click was on a URL and not just a normal click.
document.addEventListener('click', function(event) { // event.target is the element that was clicked alert(event.target.toString()); }, true);
I am trying to pass the slection made by a user to a javscript function using the onchange event. The problem is I can get the index but not the actual value. As my list is variable (dependent on a db) I cannot hard code to a static index. I either need a way to determine the number of items in a select control or a way to determine the actual selection made by the user.
Can anyone enlighten me as to the code to determine what option the user selects?
I know how to find a controls' position obviously (i.e.style left, right, top, offset, etc.), but what I'm a little stumped on is, if given two controls' positions, how can I tell if one is overlapping/ invading the space of the other?
For example, I have an AJAX dragpanel and am experiencing the common 'bleed through' of dropdown controls when I drag the panel over them. Naturally the customer doesn't like this. I experimented a little with the IFrame solution, but did not have much luck. It seems easier now to just use the 'ondragend' event and show/hide dropdowns accordingly.
Does anyone have a piece of code where, given two control objects as passing parameters, it returns true or false in regards to them overlapping or not?