javascript

Set back again the current menu link to "active" once navigation through menu stops

Ok, maybe you can't understand much from the title, so I'll try to explain it a bit more in here. Basically I have a navigation, like this: <ul class="primaryNav"> <li class="nav1"><a href="#" class="inactive" title="About us">About us</a></li> <li class="nav2"><a href="#" class="inactive" title="Our world">Our world</a></li> ...

Passing information to jqModal

I'm using jqModal inside a Django application. What I would like to do is have a bunch of different links each of which passes a parameter to jqModal to have it call a different ajax url based on the parameter. For example, depending on the ID of what is click on, I want to do something like: $('#popup').jqm({ajax: '/myapp/objects/' +...

menu with jquery

I want to make a menu for the admin side of a website and when I saw the top bar of stubleupon I wanted to make a menu with same style, always on top even when you scroll down, and has drop down items. here is the link to sumbleupon exemple : http://www.stumbleupon.com/su/2qQfq3/www.thevirtualpiano.com/ and I am not very good in javascr...

php syntax query

i have 2 questions to ask: first of all, in while ($row = mysql_fetch_object($result)) i have an object: $row->atitle now through javascript, i want to print on the page an ++increment of the current object of the array. i am doing this: hidephp = document.write("<?php echo .$row->atitle.["+inc+"];"+" ?>"); the above doesnt seem t...

Show window inside any web page

Hi, I want to implement a utility for myself that should provide a small console where I can execute random JS in any browser (much like Firebug's console - I don't reinvent the wheel, I just want to do something I need and just have fun doing it). So the usage use-case would be this: Click a bookmarklet from any browser. It show...

reinstate Jquery features after flash callback

Hello all, I have a page that uses the jQuery.swfobject plugin to embed 5 flash items into a page and each flash item has a callback using externalInterface. The callbacks work when I have the js function outside of $(document).ready(function() but the jQuery animations do not fire - the ajax load however does. Does anyone know how to...

JSON use in Javascript

I have been mis-interpreted. I have created a JSON Object in PHP. I just need access to that object in Javascript. thats all. i just learned that many of my problems can be solved by using JSON. now how to use JSON is another problem, though ;-) suppose this is the code in PHP: $row = array() while ($row = mysql_fetch_object($result) ...

Trouble with functions (javascript)

I've built a working page with lots of javascript. The javascript is placed in between the <head></head> tags without a problem, but I really want to move it an external file. I though I would be able to simply cut and paste all the code minus <script></script> tags but incuding $(document).ready(function() { }); it into a .js file and...

Variable outside event handler's scope

I am having a Javascript kerfuffle that goes beyond my knowledge of the language. I am creating a custom plugin for CKEditor. The plugin is an IFrame that opens in a DIV generated by CKEditor. Inside the IFrame, I am displaying a number of images. If the user selects one of those images, the HTML code necessary to display that image i...

How to get all css's settings using jquery?

I'd like to know all css settings in page using jquery. I know to get some css's setting, we do like this, $('#container').css("width") As this, I tried to use $('*') to get all css settings but couldn't success. Please give me some advice. ...

jQuery -> Change Window.href

How would I use jQuery to redirect the page to teh base page + some string? Specifically, I need to set the window.href = current page without params + 'SomeString'; ...

xmlHttp string passing

the current xmlhttp function i am using is passing a very tiny int to the php file for processing using the GET method. xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="user_submit.php"; url=url+"?vote="+value; url=url+"&sid="+M...

Selecting an entry in a grid view table using java/javascript

Hi all, I am automating a an application written in C#. i dont have its code. in application there is a grid view table containing list of templates. i want to select a particular template by its name and not its row index. for example: consider the grid view table consisting list of months. Now i want to select "May" month in the li...

receiving data in php through jquery ajax

i just got the hang of using jquery ajax for example, this code sends the contents of the comment box to the php file. $.post("user_submit.php", { comment: $("#comment").text() }); the question however is how do i receive the data in the user_submit.php file? ...

Disable backspace in textbox via javascript

I have a textbox which is extended by an Ajax Control Toolkit calendar. I want to make it so that the user cannot edit the textbox and will have to instead use the calendar extender for input. I have managed to block all keys except backspace! This is what I have so far: <asp:TextBox ID="TextBox1" runat="server" onKeyPress="javascrip...

jquery copy json object

I'm iterating through a set of json data which carries results of a few database tables. Amongst other data I have a RateTable ...erm... table, and a Resources table. The RateTable has a property name ResourceId which links to the Resources record. So, I'm iterating through my RateTable and I need to reference my Resource record and us...

run another function after preceding function has completed?

if i fire up 2 functions like this: prepare_data(); read_data(); then i guess they are running at the same time. but as you can see function two is depending on the first one, so how can i make the latter one run after the first one is completed? ...

$.post not POSTing anything

i am using the following jquery to post comments to user_submit.php var submit = document.getElementById("submit_js"); var comment = document.getElementById("comment"); $("#submit").bind('click', function(){ $.post("user_submit.php", { comment: $("#comment").text() }); }); the user_submit.php listens like: $comment = htm...

Is this piece of Javascript inefficient?

I was just wondering whether this snippet of Javascript is going to slow down my site: $(function(){ var realLink = location.href; $( "#nav a" ).each( function( intIndex ){ String.prototype.startsWith = function(str){ return (this.indexOf(str) === 0); } var pageLink = $(this).attr("href"); if ( realLink.startsWith(p...

not able to receive POST data in php file

UPDATE this is the screenshot of the alert: i am using the following JQuery function to successfully POST data to the user_submit.php file, its just that the php file is unable to receive the data. $(function() { $("#submit_js").click(function() { $.post("user_submit.php", { comment: $("#comment").val() }); }...