Basically, what I'm trying to do is set the left margin of an image based on the width of the image, because I want the image to appear centered relative to the link table above. I've been using this code:
function insertImageMargin(){
var marg = getImageMargin();
document.getElementById("comic").style.marginLeft = marg + "px";
} function getImageMargin(){
var com = document.getElementById("comic");
return 440 - com.width / 2;
}
What happens is, the first time com.width is 0, but if I hit reload, it is the width of the image, and the code works correctly. How do I get this to work the first time.
I am trying to hide tables when a page initially loads and only display them when a button is pressed. When the page loads the tables show and I need then to be hidden. What am I doing wrong? I am new to this.
Here is the code that I have so far.
<Script = text/javascript> function show_hide(tblid, show) { if (tbl = document.getElementById(tblid)) { if (null == show) show = tbl.style.display == 'none'; tbl.style.display = (show ? '' : 'none');
I am using the Cascade plugin [URL]. I have been searching for a while and haven't found a solution to this yet. I am trying to set the initial selected option when the page loads.
I've almost finished employing the jQuery Accordian and Tabs UI functions on a website, but still have one remaining problem.I have a page using the UI tabs. When the page first loads the content of all the tabs flashes for a second or two and then the selected tab is displayed. After that the tabs work great with smooth transitions as expected.
The tabs on page load are filled with php include calls. Then I use ajax to refill the tabs base upon the users selections. That works fine without the load flashing of all tab contents. I did try switching all the php includes to jQuery ajax. The resulting page had the same problem with the content of all tabs flashing before the selected tab displayed.Here's some of my code:In the head:
Is my code the problem or is there something I'm leaving out that would hide the copy of the tabs loading until the document is ready and selects the first tab (index 0)?
I've got a problem on a site using AJAX navigation where when you first request a page, parts of the script haven't been executed, but if you visit again, it's fine. Is there a common pitfall causing this problem?
I found a nice little script to auto reload a div every X amount of seconds. The only problem is that it's not working in IE but it's working perfectly fine in FF.
and in this code, it works, the call is made and text is added. in the other code I don't get a change at all. Not even in the database that add.php manipulates.
I'm running into a little bit of a problem with tinyMCE. My textarea is not loaded with the initial first page load but dynamically inserted in the DOM via ajax, so it doesn't display.
I've studied the documentation that comes with tinyMCE and it still kinda puzzles me what I have to do to "dynamically load" tinyMCE.
I currently have a grid of thumnails which when clicked will load an image at the top of the page without reloading the page.This works wonderfully, However, what I need to do now is to produce the same thing but instead of loading an image, load an html file into the page without reloading.
I've a small external .JS library that allows a non code-savvy user to occasionally update a list of values that are read as a JS array and used to populate the <option>s of a <select> in the calling page's form.
Anyway, is there a way by which I can ensure, regardless of the user's browser settings, that the JS library is not used from cache but re-read each time, to ensure the up to date list is used?
If not, I might as well put the JS array code back in the calling page, especially as the split is for ease of use by the page's owner, albeit with increased change of editing errors. A database solution, etc., is inappropriate here.
To enhance user experience on my site, I've moved a few page elements (well, the ads...) to the end of the page (in a hidden div) and when the page is loaded the content of such divs are copied to their appropriate location on the page. This makes the content load much faster and thus not delay the user.So what I did works perfectly with IE/Opera but th FireFox is causes the page to try and reload, which it never succeeds to and so we're stuck with a blank page. So yes, the problem is that there are document.write calls inside those divs which contain script but I cannot change it (google ads / ebay ads)I even tried to use setTimeout() to ensure the content is loaded (and can see that it is) but still when the move is done, the page tries to reload.
Can someone point me to method for loading random image (in container) on pageload? I have three image containers and I want to load a new image in each one at each pageload, but I want to be sure no two images are the same at the same time (if that makes sense!).
I wrote this code but it only works every other click So it doesn't work the first time it's called, but it does the 2nd time etc.Zero errors reported. What's wrong? javascript Code:
I have created a very simple JavaScript code to display larger images of a thumbnail image on the main section of a website. It works fine in FF3 however in IE 7 is giving me an error code of Invalid argument on line 6 character 1. The funny thing is I have used this exact code in another site and it worked fine with IE 7.
I'm just starting JavaScript and wrote a quick script for Next/Back buttons for a page showing a family outing on our boat. I proudly uploaded the webpage and emailed it out, but people running IE are unable to use the buttons, they simply do nothing.Here is the .js file, I don't think anything in the HTML or CSS is causing the issue but could post those as well if necessary.
var step = 1; //preload images var numImages = 13;
function Search( name, category ) { var sresults = []; var sri = 0; if( category != "Any" )
[Code]...
This is probably the weirdest thing I've ever seen. I know the code works since Firefox will output things, but it ONLY outputs when I throw in an alert statement somewhere in the function that gets called. It doesn't matter if it's at the beginning and just says Hi, but then it will run correctly. Without it, Firefox won't go through the function apparently and won't write out the results. I don't understand why this isn't working or why firefox is doing this.
I've inherited a page that enters data into a database, some of the fields are calculated and one uses today's date. In Firefox it all works fine but in IE it wont load the full page.
Ive been sitting with my cod for a while now and dont see what to change..
Im fetching data to a div in the page from n Server side ASP page.
Its all working in Firefox browser but not all runs in IE.
Code:
function displayLocation() { var Results; if (xhr.readyState == 4) {
[Code]....
I added an Alert as you will see so i could see in IE if the responseText data was getting there and it seems to be fine, it just wont display the data in this line...
I'm attempting to learn Ajax and the simple test program I wrote works great in all major browsers (IE8, FireFox, Opera, Chrome, etc).The javascript calls a tiny perl program to replace what is in the <div> area with a random number.The problem I'm having is the code does work in IE6 and IE7, but unlike the other browsers you can only click on the link to activate the AJAX function one time. After the second or more clicks it will not provide a new random number like it does in the other browsers.The only way I found to get a new random number in IE6/7 is to first clear my temporary internet files. The I get one more click and it provides a new random number but stops again until I re-delete my temporary internet files.The test program is located here:
I have a single webpage that contains information on all 50 U.S. states. There are 50 links at the top to jump down to the state you want, and at the bottom of the information for each state a Back to Top link.
I'm making the Back to Top link into something more complex, and it will require three or four lines of code.
So that I don't have to repeat the code 50 times, and create a burden when I need to edit it, I want to place it in a .js file and call it x. Then below the information for each state I'll simply have:
Does calling code from a .js file 50 times slow down the page load? Which method would load faster?
I am using jquery to popupa calendar. I have done this on several pages with not problems this one page keeps claiming the error below. Message: Object doesn't support this property or method
I am using a jQuery script to create charts called Highslide. I posted for help on their forum but they are a little slow, and this issue is really regarding a javascript error, I believe.
This issue happensoccasionallyin Internet Explorer 8, where the chart wont appear at all and throws an error. If you refresh the page again, it will display the chart fine. Ive been through this code and can not find what the problem is. what is odd, is if i put the code up on another server it works the first time.