javascript

how to show news without marquee tag

Without use of marquee tag I want to show news like below code.I want to use JavaScript instead of marquee tag. How to use JavaScript to do this? <marquee style="width: 292px; border-bottom: 1px solid rgb(221, 221, 221);" align="top" behavior="scroll" direction="up" onmouseout="this.start();" onmouseover="this.stop();" scrollamount="...

table sorting, paginating script problem

i'm trying to find table sorting and paginating script, and i've found a good one, but there is some problem i can't understand anyway. look at demo please the pagination must be in the center, but in IE it on the left side. i've download the script and try to correct it, but i can't. maybe you can understand what is the problem, or m...

Jquery load() loading more than I want...

Hi, I am trying to load just the contents of a <div> into another <div> on the same page using a jquery function. But when the function triggers, it loads the entire <HTML> document into the specified <div>. Any idea why it would be doing this? My code is as follows: Jquery: function button1() { $('#sidebar-content').fadeOut(functi...

function working fine in IE but the same funtion is not working for mozilla 3.6

function VisibleDiv(obj) { if (obj == BaseLog) { var objStyle = document.getElementById('DivCalls').style; if (objStyle.display == "block") objStyle.display = "none"; else objStyle.display = "block"; } else if (obj == ViewReports) { var objStyle = document.getElementById('DivReports').style; if (objStyle.display == "block") objStyle.disp...

Long task in Javascript / jQuery

I have a long task in Javascript that should be performed before the web page content is displayed. During the execution of this task I would like to show an image whose opacity will grow up to 100% (when the task is done). How this can be achieved ? ...

how to active a link using javascript

I have following links <ul class="dropdown dropdown-horizontal"> <li><a href="#" class="dir" onClick="clickMe('Wall'); selectedTab('Wall');">Wall</a></li> <li><a href="#" class="dir" onClick="clickMe('Introduction');">Introduction</a></li> <li><a href="#" class="dir" onClick="clickMe('Activities');">Activitie...

losing leading & trailing space when translated using Google Machine Translation

Hi , I am using google ajax based translation API like in the below example. google.load("language", "1"); function initialize() { var text = document.getElementById("text").innerHTML; google.language.detect(text, function(result) { if (!result.error && result.language) { google.language.translate(te...

min or gzip, which is better?

jquery-1.4.2.min.js is 71.8KB Same file compressed through this tool, with gzip enabled, becomes 32.9 KB Which is better? If latter, why doesn't jQuery provide a packed file too instead of just uncompressed and min versions? My Question: One is minified and gzip enabled, other is minified and packed and gzip enabled. Which should I use...

How do you get an ID of a clicked div element in JavaScript?

So my question is how to get an ID of an element that has just been clicked? (JavaScript) Thank you for your answers! ...

Issues using $.ajax

I want to load the lightbox javascript only when a certain condition is satisfied so I'm loading it using $.ajax like so: $.ajax({ url: "../static/js/lightbox.js", dataType: 'script', cache: true, success: function() { alert('loaded'); $("a.lightbox").lightbox({ opacity: "0.6", width: "940" }); }}); I see t...

Trying to parse xml file for javascript quiz

Hi I am trying to create a javascript quiz, that gets the questions from a xml file. At the moment I am only starting out trying to parse my xml file without any success. Can anyone point me to what I am doing wrong? <html> <head> <title>Test</title> <script type="text/javascript" src="prototype.js"></script> </head> <body> <div class=...

Long task in Javascript

Why in the following code I see the whole page at once ? Thanks ! HTML: <div></div> CSS: div { width: 100px; height: 300px; border: 1px solid black; text-align: center; } Javascript: $(function() { for (var i=0; i<15; i++) { sleep(100); $("div").append("<span>--- " + i + " ---<br /></span>"); ...

The Canvas .fillText method doesn't seem to work on the iPad.

It does show text, but in the completely wrong place (not even on the Canvas element itself!), and in the wrong color (always black). Has anyone had experience with this or gotten it working? ...

Remove Attributes onmouseover and onmouseout

Hello all, I am trying to make use of JQuery's remove attribute like this: $('#rom-img_1').removeAttr('mouseover'); $('#rom-img_2').removeAttr('mouseout'); However, it does not remove the effects of the events as the events are still triggered on mouseover and on mouseout. I have tried adding "on" before the events names too but JQue...

C#: Label contains no text

Hey I would like to get the text out of a label. But the label text is set with Javascript. On the page I can see that there is text in the label, but when I debug it shows this: "". So how do I get the text out of a label that is set with Javascript, at least that is what I think is the problem. My code: <asp:TextBox ID="txtCount" r...

Using innerHTML.repalce to replace text with img element

I'm writing a script to add extra smileys to the Gmail chat. Its working partially, i'm stuck with the innerHTML.replace method @line 33 If you see, the regex in the replace method is passed using a variable. This is where the script is choking. If i replace the variable with the actual regex, it works fine :| ...

facebook JavaScript SDK - what is the 'your app id' when you just want to use the SDK for the facebook 'Like' button?

I want to add the facebook 'Like' button to my website, but the JavaScript API is asking for 'your app id' <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({appId: 'your app id', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.a...

Need background sound + play once

I have a script and when it detects a difference it plays a little alert sound. When it alerts the sound plays but loops, how can I stop this? ...

Javascript tail recursion

Why the following code runs so.... slow....... ? <html><body><script type="text/javascript"> var i = 0; f(); function f() { if (i == 5000) { document.write("Done"); } else { i++; tail(); } } function tail() { var fn = tail.caller; var args...

Html Select List: why would onchange be called twice?

I have a page with a select list (ASP.NET MVC Page) The select list and onchange event specified like this: <%=Html.DropDownList("CompanyID", Model.CompanySelectList, "(select company)", new { @class = "data-entry-field", @onchange = "companySelectListChanged()" })%> The companySelectListChanged function is getting called twice? I a...