 |

|
Hi there.. I wrote a nodejs article and posted for moderation. It is neither showing any change in its moderation status from pending.. nor is it showing up on the 'articles pending review' section. Did I have to do something which I missed because of which it is pending.. or am I missing to understand any reviewer comment ? <a href="http://www.codeproject.com/Articles/339740/Know-Javascript-use-node-js-server-side">Know Javascript..use node.js server-side</a> -Harish
|
|
|
|

|
You have only just posted this so it is awaiting acceptance from the reviewers. Please be patient, everyone here contributes in their own time and at no cost (to you).
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|

|
Article updates (requested edits or moderation queue checks) typically take a couple of working days.
|
|
|
|

|
I have define a variable in window A.
I set it to parent.variable=xxxx
Now I open a new tab (window B).
Can I access or take the parent.variable from window A in window B ?
|
|
|
|

|
Only if window B can refer to something in A's tree. I think when A spawns B it gets a reference to the new window, so A can add a reference to its own window into B's (i.e. new_window.referenceToA = window), and then code in B can use window.referenceToA.xxx.
|
|
|
|

|
If you opened the new window from the original window, you should be able to access the window.opener property in the DOM of the new window. This property gives you access to the DOM of the original window.
Here is a link to the MDN entry for this property click[^]
Cheers!
|
|
|
|

|
You might want to use a 'hidden' input on your form. When the page opens in the iframe you can grab the value from the Request object and use it in your iframe. I see the requirement not to use cookies.
Jack
|
|
|
|

|
Hmm: I was going to say "what's your question?" but I think you've just posted in the wrong place - this belongs as an answer to a thread below I think.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|

|
Hey,
Any ideas why this won't work? i want the text and image to go back to the original position then repeat the previous animation, so the text goes out to the right then resets, and comes back in from the left, and the same for the image ..
<
<html>
<head>
<script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<script type="text/javascript">
$(document).ready(function(){
bringIn();
function bringIn()
{
$("#animation_image").animate({top:10},"slow");
$("#animation_text").animate({left:30},2000);
window.setTimeout(takeOut, 5000);
};
function takeOut()
{
$("#animation_image").animate({top:401},"slow").queue(function(){
$("#animation_text").animate({left:1000},"slow",bringIn);
//new
$("#animation_text").css({"left":"-600px"});
$("#animation_image").css({"top":"-200px"});
$("#animation_text").html("Why you no working");
});
};
});
</script>
</head>
<body>
<button>Start Animation</button>
<br /><br />
<style type="text/css">
#animation_box
{
position:relative;
width:800px;
height:300px;
margin:0px auto 0px auto;
background-color:#333333;
overflow:hidden;
}
#animation_text
{
position:absolute;
display:block;
z-index:2;
left:-600px;
top:20px;
width:300px;
font-family:Arial, Helvetica, sans-serif;
font-size:30px;
line-height:45px;
color:white;
}
#animation_image
{
position:relative;
display:block;
float:right;
top:-200px;
margin-right:10px;
}
</style>
<body>
<div id="animation_box">
<div id="animation_text">
<ul>
First 3 hours £36
</ul>
</div>
<div id="animation_image">
<img src="img/slides/img8.jpg" id="animation_img" width="420px" height="280px" alt="Car image"/>
</div>
</div>
</body>
</html>
Thanks for all your help
|
|
|
|

|
how can i pass parameter from 1 page to another using javascript i cannot use query string and cookies.
{ my task is i have a page page1 in which there are two links on clicking that link it open in iframe of new page page2 }
any suggestion would be great help for me
Thanks in advance.
|
|
|
|
|

|
Take hidden field in the form assign variable value.On first page <script> tag write window.open("Page name") and on second page <script> use this code window.opener.document.getElementById('text1').value
|
|
|
|

|
Hi,
I have a myPage.aspx page and 2 user controls, ucA and ucB. ucA (parent control) is being used in ucB (child control inherits ucA). Finallly ucB is registered in myPage.aspx. I have two dropdowns in ucB.
Now, I am trying to put the selected values of these dropwdowns in a hidden variables using the below code and I am putting this in myPage.aspx page_load code
Page.ClientScript.RegisterHiddenField("LabValue", labname selectedvalue using FindControl)
Page.ClientScript.RegisterHiddenField("ClientValue", ClientName SelectdValue using FindControl))
The above code runs fine and no errors.
Now in the exeternal .js file I am accessing this values as
var lv = document.getElementById("LabValue").value;
var cv = document.getElementById("ClientValue").value;
All look fine. But the issue is no matter what values I put in the LabValue and ClientValue hidden fields I always get the values as 0 for lv and cv (java script variables).
Say for instance if LabValue is 10002 when I try to access it via javasacript using document.getElementById("LabValue").value; I always get 0 instead of 10002. It is the same case with the other hidden field too.
When I looked at the myPage.aspx viewsource I always see
<input type="hidden" name="LabValue" id="LabValue" value="0" />
Am I missing some thing here?
Thanks in advance,
L
modified 24 Feb '12 - 20:04.
|
|
|
|
|

|
I assume you are after the functionality of tracking the mouse position using those red lines on the top and left of the content area...
You can use the jQuery mouse move event to track the mouse position. You can then position some red colored divs at the x and y coordinates of the mouse.
|
|
|
|

|
No Sir,
I want the Ruler which is On the corner of the Image Layout with margin.
If you can think then I Can.
|
|
|
|

|
Did you bother reading the source code?
|
|
|
|

|
Hello Dear,
I am providing a code you add own event just like the following code commented.
<script type="text/javascript">
var OnMapCreating = function(map) {
var mapParser = Map1.GetMapParser();
mapParser.addControlsInJson = function(controls, onDrawEnd, onEditEnd) {
for (var key in controls) {
if (controls[key]) {
if (key == 'Modify') {
if (onEditEnd) {
controls[key].onModificationEnd = onEditEnd;
}
} else if (key != 'Normal') {
if (onDrawEnd) {
controls[key].featureAdded = onDrawEnd;
//controls[key].featureAdded = function() {
// alert('ok');
//}
}
}
this.map.addControl(controls[key]);
}
}
}
}
script>
|
|
|
|

|
i'm trying to call a web service from java script code stored NOT in Html but in an extenarl file .js. My code is this:
service.useService("http://localhost:10000/WebS_cod_01/WebS_codEurService.asmx?wsdl", "WebS");
Photo = service.WebS.callService("webS_codEurProcessWS" , photoID);
checking with Firebug i find this message:
"service is not defined"
where i'm wrong ?
thanks in advance
|
|
|
|
|

|
i am using console.log() in my code.where the output will be printed.
modified 16 Feb '12 - 0:42.
|
|
|
|
|
|

|
Hi,
i like to disable the buttons on check of the checkbox....using Jquery
i have tried in 3 different ways...
1.attr("disabled", true)-- working in IE not in FF
2.attr("disabled", "disabled")- working in IE not in FF
3.attr("diabled") not working in both...
i want to know the property which is supported by all the browsers(like safari, chrome etc..)
thanks in advance
|
|
|
|

|
I suspect the problem is somewhere else. $('#id').attr('disabled',true) is working for me in FireFox, IE, Chrome and Opera. Setting it back to 'false' enables the inputs again.
|
|
|
|

|
I agree with graham
I tested with
below code:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<div>
<input type='checkbox' value='10' id='id'> <label for='id'>Test Checkbox</label>
</div>
<BUTTON onclick='a=!($("#id").attr("disabled")); $("#id").attr("disabled",a)'>
test
</BUTTON>
it work fine
|
|
|
|

|
If I will use <asp:Button ...> and <asp: CheckBox...> ....How can I disable checkbox
|
|
|
|

|
The code you are using has always worked for me so not sure what's wrong but as a point, the second one in your list is the correct one. If you are trying to enable the check boxes again you will have to use the removeAttr method as W3 standards say that the mere presence of the disabled attribute means the control is disabled, regardless of value (which some of the major browsers follow).
As for why your check boxes don't disable I can only suggest that IE and FF are handling your HTML differently (check Id's are the same, that you are only trying to set the disabled attribute after full page load (use $(document).ready if you aren't!) etc. etc.)
Hope this helps,
Ed
|
|
|
|

|
How can i use backbone.js.What is the purpose of backbone.js.Post some sample code.Actually i tried on google.I am not getting correct solution.
|
|
|
|

|
DeepthiTanguturi wrote: Actually i tried on google.
And you couldn't find this[^]?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|

|
I've hit a wall trying to use javascript to write a table with some image tags. I'm looping through an array of image names, then setting their src attribute. The function is creating the <img> tags, but all that displays is the 'missing image' thumbnail. The function is fired via a button. Below is my code.
Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex">
<title>Testing Javascript</title>
<script type="text/javascript">
function getImages() {
// Declare variables
var allImages, vRow, vCell, vText, vImg;
var vCnt, i, j, x, y;
var vTable = document.createElement("TABLE");
var vTBody = document.createElement("TBODY");
// Insert vBody into vTable
vTable.appendChild(vTBody);
// create an array
var images = new Array();
images[0] = "image1.jpg";
images[1] = "image2.jpg";
images[2] = "image3.jpg";
// count values in the array
vCnt = images.length;
// loop through the array of images and answers
for (i=0; i < vCnt; i++)
{
// create a row
vRow = document.createElement("TR");
// create a TD tag
vCell = document.createElement("TD");
// create IMG element
var image = images[i];
vImg = document.createElement("IMG");
vImg.setAttribute("src", "images/" + image);
// insert the img tag into the td tag
vCell.appendChild(vImg);
// insert the cell into the row
vRow.appendChild(vCell);
// insert the row into the table
vTBody.appendChild(vRow);
}
// add the table to the doc
var vTableContainer = document.getElementById("vTableContainer");
vTableContainer.appendChild(vTable);
}
// end updatePage()
</script>
</head>
<body bgcolor = "#FFFFFF">
<h2>Javascript and Images</h2>
<div id="parentDiv">
<p>
Trying to set the image source with js...
</p>
<div id="childDiv">
<form method="GET">
<input type="button" value="DISPLAY IMAGES" onClick="getImages();" />
</form>
</div>
<div id="vTableContainer"></div>
</div>
</body>
</html>
|
|
|
|
|

|
Dean, Thanks for the reply. I've been working with the jquery api just a bit today, and I really like it. Thanks for the reference!
|
|
|
|

|
Please vote if you found my answer useful.
thanks
|
|
|
|

|
I just checked about setAttribute. It seems that only Firefox implemented it properly.
JQuery is a very good choice. for your information you can also use
imgobject.src='my/image/source.jpg'; //it will do fine
|
|
|
|

|
(1) Please don't use names of collections for private vars
so var images = new Array();
better var arArrayOfImagesObjects=new Array();
images is al pre-dfined collection: document.images
see http://msdn.microsoft.com/en-us/library/ms537461.aspx
(2) To set scr:
valueof .src is not same like pure string
preload image
var imgObjekt1=new Image(); // height and width if you want
imgObjekt1.src='whatYouWant.jpg'; // maybe with path
vImg = document.createElement("IMG"); // check pionter !
if(vImg!=null)
{
// append into object (into child of body) // append into collection images automatically
// check pointer of appended object, use e.g. var imgAppendedImgObject
if(imgAppendedImgObject!=null)
{imgAppendedImgObject.src=imgObjekt1.src; // will be (now) rendered in body
// don't use setAttribute("src", "images/" + image);
}
}
(3) FIRST optimize your code during edit and THEN check errors at run time.
to createElement and appendChild
check always pointers != null
if you use a collection like images check too
declare vars inside of function --> local vars
declare vars inside of for{} --> declare 1 time outside of for and use inside
declare constants like "image1.jpg" outside of function --> use global code e.g. at begin of js-file (easy find and edit in js-file).
|
|
|
|

|
Would someone please tell me why this js won't display images in IE 7, but works perfectly in Firefox? I'm using Windows XP, and I've double-checked all my settings in IE 7. Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Sample</TITLE>
<SCRIPT LANGUAGE="JavaScript">
window.onload = fnWrite;
function fnWrite()
{
var vTable = document.createElement("TABLE");
var vTBody = document.createElement("TBODY");
var vRow, vCell, vDiv, vImg;
var i;
var images = new Array();
images[0] = "images/treble_f1.JPG";
images[1] = "images/treble_c1.JPG";
images[2] = "images/treble_d1.JPG";
images[3] = "images/treble_e1.JPG";
vTable.appendChild(vTBody);
vRow = document.createElement("TR");
vTBody.appendChild(vRow);
vCell = document.createElement("TD");
vRow.appendChild(vCell);
for (i=0; i<images.length; i++)
{
vDiv = document.createElement("DIV");
vCell.appendChild(vDiv);
vImg = document.createElement("IMG");
vImg.src = images[i];
vImg.setAttribute("alt", "image");
vCell.appendChild(vImg);
}
vTableContainer.appendChild(vTable);
}
</SCRIPT>
</HEAD>
<BODY>
<H1>Javascript Won't Work in IE 7</H1>
<div id="vTableContainer"></div>
</BODY>
</HTML>
|
|
|
|

|
Try moving the line
window.onload = fnWrite;
after the fnWrite() function block.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|

|
Thanks for the reply, however that did not fix this problem. The IE browser does display the little thumbnail box, which tells me the image tag is there, but this line of code
vImg.src = images[i];
for some reason is not setting the source for the image. I've even tried hard coding in the source with no luck.
|
|
|
|

|
Sorry, it was a bit of a stab in the dark, but I know that there are some strange inconsistencies between IE and the other browsers.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|

|
Thanks for the reply. Well, I removed the javascript from the HTML page and put it in a js file, and now it works. Go figure... Thanks a lot, Microsoft. :(
|
|
|
|

|
This[^] may help explain things.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|

|
I've just tried your code with MS-IE7 on WXP and it works for me! I have a similar problem with code generated on the fly and displayed using IE.navigate using automation - the images come up with the red [x] box or the 4 symbol box but if I show the source, save it, run the saved version the images come up correctly. Are you using IE automation or simple file opening?
|
|
|
|

|
A massive problem of Microsoft
If you want reders animated gifs then that will by chrashed by Internet Explorer
preload img with '?' after suffix (:gif?) have no result: animated gif even not rendered.
e.g.
// X00 is an existing image object
// X01 is an existing preloaded image object with filled .src of an animated gif
X00.src=X01.src+'?'; // only if IE exists
X00.src=X01.src; // for opera etc.
preload image
var imgObjekt1=new Image(); // height and width if you want
imgObjekt1.src='animated.gif'; // maybe with path, but not with '?'
vImg = document.createElement("IMG"); // check pionter !
if(vImg!=null)
{
// append into object (into child of body) // append into collection images automatically
// check pointer of appended object, use e.g. var imgAppendedImgObject
if(imgAppendedImgObject!=null)
{imgAppendedImgObject.src=imgObjekt1.src+'?'; // will be (now) rendered in body in IE
}
}
|
|
|
|

|
Hi,
i am not able set the args.isValid as false for JS function...which is not having custom validator..
find the code below:
<asp:LinkButton runat="server" ID="btnApply" TabIndex="1" CssClass=" primary" OnClientClick = "return ApplyClick(this);" >
JS Code:
function Applyclick(args) {
if (errMsg != null) {
args.IsValid = false;
}
return false;
}
thanks in advance
modified 2 Feb '12 - 5:03.
|
|
|
|

|
I am sorry I dont know asp.net but yet
what is args and who is calling ApplyPromotionClick ???
I know I am coward since the day I know that fortune favors the brave
|
|
|
|

|
Sorry function name should be applyclick
|
|
|
|

|
In that case Check your Firefox or Chrome error message. I cant recall any html object property IsValid. I think you need to say more clearly what you need
I know I am coward since the day I know that fortune favors the brave
|
|
|
|

|
Hello everyone, I would like to know if you can help me out in a simply task yet I cant get my way around it.
Ive manage to update a single DIV but cant update a php file with several different DIV.
Data is comming from a mysql query using a separate php file.
This is what ive got, please can you help me write a simple code to recover more than one piece of data from a mysql query and update all the divs of an html,php file?
<pre lang="Javascript"> <<pre lang="xml">html>
>
|
|
|
|
 |