javascript

Javascript regex URL matching

I have this so far: chrome.tabs.getSelected(null, function(tab) { var title = tab.title; var btn = '<a href="' + tab.url + '" onclick="save(\'' + title + '\');"> ' + title + '</a>'; if(tab.url.match('/http:\/\/www.mydomain.com\/version.php/i')) { document.getElementById('link').innerHTML = '<p>' + btn + '</p>'...

document.write issue

I inherited a piece of code that uses document.write to insert a certain div when the code is encountered. Unfortunately, this code is causing issues in IE where the code fails. Is there a way around this to insert a div on the page without it? I can't make a big change since this code is currently used by many clients(it's like googl...

How to execute PHP code from within javascript escape/unescape ?

<Script Language='Javascript'> <!-- document.write(unescape('<?php if ( ! defined('PROJECTNAME')) exit(''); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; </body> </html> ')); //--> </Script> I did not copy paste the whole code. There is more PHP code w...

How to use jquery to remove <div> in a table?

I'm trying to remove a few rows surrounded by a div, but it doesn't work, why? $(function(){ $("#div1").empty(); }); <table id="tbl" border="1px"> <thead> ... </thead> <tbody id="tblBody"> <div id="div1"> <tr id...

HTML Slider element?

I'm coding an app (temporarily up here), and I want to make its parameters modifiable. I feel the best way to do this would be with your standard GUI slider elements (a la this, but not so ugly). I just noticed that the DOM doesn't provide these, however... What's the best way to introduce sliders to a webpage? Is there a standard libr...

What are cons if we use javascript to apply css selectors to that browser who do not support that property by default

What are cons if we use JavaScript to apply only CSS property/selectors to that browser who do not support that property by default? to keep my HTML semantic and keep free from Deprecated HTML. Is it against content, style and Behavior separation? If I make accessible site then should i only use whatever i can do with pure css. shouldn...

jQuery: See how many elements a selector matched?

If I have a selector like $.('.active'); How can I see how many items that matched? Alternatively, is there an easy way to see if more than zero elements were matched? ...

How do I replace absolute times ("1:30 PM") with relative times ("15 minutes ago") and have them automatically update?

Is there a Javascript script to change the time and date of blogs automaticly like facebook ??? for example "10 minutes ago" instead of "May 15 2010 12:30". -Thank You ...

jQuery tooltip: Trouble with remove()

I'm using a jQuery tooltip plugin. I have HTML like this: <li class="term ui-droppable"> <strong>Fall 2011</strong> <li class="course ui-draggable">Biological Statistics I<a class="remove-course-button" href="">[X]</a></li> <div class="term-meta-data"> <p class="total-credits too-few-credits">Total credits: 3</p> ...

Telerik java script resize problem

I have an Telerik asp.net control that generate an html code that contains 2 div's, I resize this div's using js, after that this page is loading in iframe and my div's resize to default values, where is the problem?? the aspx page: http://www.filehosting.org/file/details/144561/example.aspx js function to resize: ResizeDiv() RAD_SPLI...

read xml in javascript problem

hai all, i have a problem with my code to read the xml.I have use ajax to read xml data and populate it in combobox. My problem is it only read the first data.Here is my code my xml like this <info> <area> <code>1</code> <name>area1</name> </area> <area> <code>2</code> <name>area2</name> </area...

Javascript or Python? beginner getting up to speed

Which language will allow a beginner to get up to speed quicker? Basically which language of the two is easier to learn ...

Inserting new <TD> elements into a table row.

I have created a small application written in XHTML, JavaScript/JQuery and PHP. The PHP reads and writes to a small SQLite database. How would i go about inserting cells into a pre-scripted table. The cells would need to be configured using some information from my database. For example, below are two cells with their data retrieved f...

how to get a value which points to a function

hi, i have a value like that var myvalue = myfunction(1,2); what I need is that GETTING myfunction(a,b) as a string.. I mean not "myfunction's value" hmmm, let me explain, myfunction(1,2) returns 1+2=3 if I type alert(myvalue) it returns 3 but I need myfunction(a,b) AS IT'S TYPED when I use alert. NOT IT'S VALUE think it like...

Being good in jQuery == Being good in Javascript??

I'm pretty efficient in jQuery, having implementing it in several projects for my company. However, I found myself a little lost when reading stuff like node.js. Do i have to go back to basics and learn the javascript language or should i just stick with jQuery? One more thing i would like to ask: Does coding in plain javascript increa...

Having jeditable save when focus is lost?

(How) can I tweak jeditable to save the text when focus is lost from the text area? If you don't supply submit/cancel buttons, then when pressing 'Enter' the content is saved ... but I haven't found how to save the content on focus lost. ...

How can I get returned value from JavaScript function that contain jQuery.get() ?

I have a JavaScript method that call JQuery.get() and i want to return value from itto callee function .. the following is the code : function CheckExistance(userName) { $.get( "JQueryPage.aspx", { name: userName }, function(result) { if (result == "1") { value = t...

What are the most valuable certification available for Programming?

I would like to know what are the certificates available for programming, like Zend for PHP SUN Certification for java what are the others? Javascript ? C++ ? Python ? etc... Please give me some suggestion for other available certifications. ...

Best practice for inserting large chunks of HTML into elements with Javscript?

Hey guys. I'm building a web application (using prototype) at the moment that requires the addition of large chunks of HTML into the DOM. Most of these are rows that contain elements with all manner of attributes. Currently I keep a blank row of html in a variable and var blankRow = '<tr><td>' +'<a href="{LINK}" onclick="someFun...

radgrid insert using radwinow

Hello Everybody, The company details page in my system has a user control to show the founders of the company, that user control represents the founders by using a Rad Grid and three buttons for insert/edit/delete founders, the founders grid is being bind by using a WCF service. the insert button calls a javascript method that opens a Ra...