|
There is two even you should take a look
1. onchange
2. onselect
also read the link[^] for more info
|
|
|
|
|
Dear guys,
I am just trying to inject some javascript code to a someone's web. I will then try to analyse the image obtained by getElementById.
However the image I got is every time different from what I see as I believe the image is dynamic, once I use getElementById, request is sent to server so getting new images.
I am a newbie to JS, can you please suggest how I can obtain the same image. say without requesting again, or any workaround like screencapture.
Thanks!
|
|
|
|
|
Sir;
I don't think that getElementById() function requests the server. It searches the document for the given id and returns the specific element.
But, if you sent me your code, i can see it for you.
Help people,so poeple can help you.
|
|
|
|
|
Thanks for your reply!
Well I tried to inject the JS code to a web, all things worked fine except the dynamic image.
Some of the codes are:
<pre lang="cs">
var image = document.getElementsByTagName('img')[9];
alert(image.src);
var req =new XMLHttpRequest();
req.open(&quot;GET&quot;, image.src, true);
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {
var data =req.responseText;
var data_array = [];
for (var i = 0; i &lt; data.length; i++)
{
data_array.push(data[i].charCodeAt(0) &amp; 0xff);
}
for (var i = 0; i &lt; 10; i++)
{
var o = document.body;
var div = document.createElement(&quot;div&quot;);
div.innerHTML = data_array[i];
o.appendChild(div);
}
}
}
};
</pre></pre>
|
|
|
|
|
Look, Sir;
The response come from the server cannot be fetch by XMLHttpRequest because its not XML based.
instead you can try this
var image = document.getElementsByTagName('img')[9];
alert(image.src);
var o = document.body;
var copy = document.createElement("img");
copy.src = image.src;
o.appendChild(copy);
Sir;
An image element presents an inner frame within the document that requests the server with its source (src) and fetch a response of type image.
Help people,so poeple can help you.
|
|
|
|
|
Hi Sir, Thanks for your reply!
I will try to see whether both images are the same.
Btw, what if I wanna analyse the pixels within that image.
var imageObject = document.getElementsByTagName('img')[9];
Does this imageObject contain any data in memory, or just a reference?
Thx again!
|
|
|
|
|
sir;
I am sorry, return to your first code and call XMLHttpRequest.send() at the end to send the request to the server. Just like: req.send(null)
Help people,so poeple can help you.
|
|
|
|
|
Ali Al Omairi(Abu AlHassan) wrote: The response come from the server cannot be fetch by XMLHttpRequest because its not XML based.
PLEASE tell me you don't think that XmlHttpRequest can only deal in Xml!!!!
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Actually, I wasn't aware about that. Anyway, people learn from their mistakes, right?
Help people,so poeple can help you.
|
|
|
|
|
Fair enough - we all learn things we didn't know (I won't embarrass myself by pointing out the "beginners mistake" I made a few days ago!)
There are two useful fields on the response you get back from an Ajax call - responseXml (which you've already discovered), and responseText. Now if you are indeed sending Xml back, then responseXml will be correctly filled in, and responseText will contain exactly the same.
However, if in your server side code, you do a simple Response.Write("Hello World"), then IIRC responseText will contain this, responseXml will be empty (you'll need to check that last empty point - been a while!)
What this means is that you can write ANYTHING you want back and pick it up out of responseText - one neat trick I've employed in the past is to make DataGrids render as part of an ajax call, write the Html back on the response, pull it out of the responseText and slap in into a div's innerHtml property.....
C# has already designed away most of the tedium of C++.
|
|
|
|
|
you are over my head, ya man.
100
Help people,so poeple can help you.
|
|
|
|
|
Request never goes to server.
|
|
|
|
|
A save function to be used for saving crystal report without opening.
can u help on this?
|
|
|
|
|
You'll likely have to write a webservice and then catch the return results. Look for a 3rd party tool or search google.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have a gridview of employee jobs.
One job row gets selected and some items from the row and some items from the database populate a space below the Gridview on an aspx page.
total hours is in the gridview row. The user enters the payrate into one of the fields on the aspx page. user enters another field for overtime rate. There is a DropdownList that has hourly and Hourly+. Stakeholder does not want the total hours displayed below the gridview.
After the amounts are entered the operator selects from the dropdownlist.
from a client side Javascript I need to find the row in the Gridview that was selected, get the total hours from the column of that row, then compute the total pay.
The problem is I don't know how to locate the row that was selected from the Gridview.
It is not the opject that is firing the current event.
Can you help with a small snippet.
Thanks..
|
|
|
|
|
Try using this Example :
<%@ Page language="C#" %>
void CustomersGridView_SelectedIndexChanged(Object sender, EventArgs e)
{
// Get the currently selected row using the SelectedRow property.
GridViewRow row = CustomersGridView.SelectedRow;
// Display the company name from the selected row.
// In this example, the third column (index 2) contains
// the company name.
MessageLabel.Text = "You selected " + row.Cells[2].Text + ".";
}
void CustomersGridView_SelectedIndexChanging(Object sender, GridViewSelectEventArgs e)
{
// Get the currently selected row. Because the SelectedIndexChanging event
// occurs before the select operation in the GridView control, the
// SelectedRow property cannot be used. Instead, use the Rows collection
// and the NewSelectedIndex property of the e argument passed to this
// event handler.
GridViewRow row = CustomersGridView.Rows[e.NewSelectedIndex];
// You can cancel the select operation by using the Cancel
// property. For this example, if the user selects a customer with
// the ID "ANATR", the select operation is canceled and an error message
// is displayed.
if (row.Cells[1].Text == "ANATR")
{
e.Cancel = true;
MessageLabel.Text = "You cannot select " + row.Cells[2].Text + ".";
}
}
<title>GridView Select Example
GridView Select Example
<asp:gridview id="CustomersGridView"
="" datasourceid="CustomersSource" autogeneratecolumns="False" autogenerateselectbutton="True" allowpaging="True" selectedindex="1" onselectedindexchanged="CustomersGridView_SelectedIndexChanged" onselectedindexchanging="CustomersGridView_SelectedIndexChanging" runat="server" datakeynames="CustomerID">
<columns>
<asp:boundfield datafield="CustomerID"
="" headertext="CustomerID" insertvisible="False" readonly="True" sortexpression="CustomerID">
<asp:boundfield datafield="FirstName"
="" headertext="FirstName" sortexpression="FirstName">
<asp:boundfield datafield="MiddleName"
="" headertext="MiddleName" sortexpression="MiddleName">
<asp:boundfield datafield="LastName"
="" headertext="LastName" sortexpression="LastName">
<asp:boundfield datafield="Phone"
="" headertext="Phone" sortexpression="Phone">
<selectedrowstyle backcolor="LightCyan"
="" forecolor="DarkBlue" font-bold="true">
<asp:label id="MessageLabel"
="" forecolor="Red" runat="server">
<asp:sqldatasource id="CustomersSource"
="" selectcommand="SELECT CustomerID, FirstName, MiddleName, LastName, Phone FROM SalesLT.Customer" connectionstring="<%$ ConnectionStrings:AdventureWorksLTConnectionString %>" runat="server">
|
|
|
|
|
shanghai recruitment JAVA SSE/STAFF,
Please contact MSN:snow_it@live.cn or snow_jin1001@hotmail.com ,QQ:2274676056
Senior Software Engineer (PayPal)
Primary Job Responsibilities
Design, develop and implement the engineering solutions (Applications, tools, systems, infrastructures) to detect and prevent suspicious activities in PayPal system.
Key Day-to-Day Responsibilities includes:
• Code highly available, testable, scalable, monitor-able components using C++ and Java
• Design and implement backend software components that interact with databases and other services.
• Design and develop new tools and processes to improve system efficiency and stability
• Conduct design and code reviews, fix bugs and resolve production issues
• Ability to handle periodic on call support as well as out-of-band requests
• Work effectively with globally distributed teams in multiple different time zones
Job Requirements
• Bachelors degree in Engineering, Computer Science, Mathematics, Statistics, Finance or related fields with 5+ years of experience, or Masters degree with 3+ years of experience. Ph.D degree is a plus.
• Good communication skills. Fluency in English is a must, both written and oral.
• Strong understanding of various database systems, and experience working with Unix platforms.
• Strong object oriented programming skills in Java and/or C++.
• Knowledge of SOA.
• Knowledge of Perl or Python.
Basic Qualifications
• Self motivated, learn fast, agile, be eager to stretch and grow
• Work effectively independently or as a team
• Take initiative and be willing to challenge the status quo
• Show respect for differences in opinion and reach consensus through convincing view points
• Possess intellectual curiosity and be able to handle ambiguity
• Think about both the short term and long term, act with a sense of urgency
• Influence the team to drive innovation and enforce engineering best practices across Risk engineering.
staff 级别的JD:
Staff Software Engineer (PayPal)
PayPal Risk is a critical enabler of PayPal business growth. The key goals of the PayPal Risk team include:
1. Prevent existing users from being defrauded.
2. Detect fraudsters when attempting to monetize compromised accounts.
3. Increase account activation rates, Total Payment Volume, revenue and profit through optimizing funding source availability, authorization rate, returns etc.
This position is in the PayPal Risk product development team, where the prospective candidates will work with a group of world class engineers and build cutting edge solutions to achieve the above described business goals.
Job Responsibilities
Design, develop and implement the engineering solutions (Applications, tools, systems, infrastructures) to detect and prevent suspicious activities in PayPal system.
Key Day-to-Day Responsibilities includes:
• Code highly available, testable, scalable, monitor-able components using Java and/or C++
• Design and implement backend software components that interact with databases and other services
• Design and develop new tools and processes to improve system efficiency and stability
• Conduct design and code reviews, fix bugs and resolve production issues
• Ability to handle periodic on call support as well as out-of-band requests
• Work with Risk Analysts and Floor Managers to help implement enhancement requests
Work effectively with globally distributed teams in multiple different timezones
Job Requirements
• Bachelors/Masters degree in Engineering, Computer Science, Mathematics, Statistics, Finance or related fields with 8+ years of experience, or Masters degree with 5+ years of experience. Ph.D degree is a plus.
• Good communication skills. Fluency in English is a must, both written and oral.
• Strong understanding of various database systems, and experience working with Unix platforms.
• Strong object oriented programming skills in Java and/or C++.
• Knowledge of SOA.
• Knowledge of Perl or Python.
Key Competencies Needed:
• Self motivated, learn fast, agile, be eager to stretch and grow
• Work effectively independently or as a team
• Take initiative and be willing to challenge the status quo
• Show respect for differences in opinion and reach consensus through convincing view points
• Possess intellectual curiosity and be able to handle ambiguity
• Think about both the short term and long term, act with a sense of urgency
• Influence the team to drive innovation and enforce engineering best practices across Risk engineering.
|
|
|
|
|
Hi!
I've given the source code for a web site. I've to host it to localhost(in XAMPP) and test the site. I've installed XAMPP and copied whole source code to htdocs folder of XAMPP installation. Now I've to run the website from localhost. For this I need to know which file I've to call from the browser. Where will it be embedded? Sorry if this is a silly question. I don't know anything about web programming.
|
|
|
|
|
Look for any file marked Index or Default.
That will be the start page that the browser looks for.
---------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
English League Tables - Live
|
|
|
|
|
Sorry Dave, but I can't just let that one slide....
I think you're getting a little confused by the default document (which is indeed usually called index or default, or even login!) - this is set in IIS / Web server to determine which file to send to the client when none is specified, so if your start page is http://blah.de.nobbs/default.aspx then entering http://blah.de.nobbs is sufficient - IIS then looks at what the default doc is and serves that back to the client.
Has nothing at all to do with the browser above and beyond making a request and recieving a response.
C# has already designed away most of the tedium of C++.
|
|
|
|
|
pix_programmer wrote: I don't know anything about web programming.
Then I suggest you start here[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Oh, c'mon, he could at least go here!
|
|
|
|
|
Hi
I have an array of objects that store information. call it guests. Lets say I have 5 guests added and I delete guest[2] then there will be 4 guests left. The array index does not auto correct in JavaScript. The values that are left are stored as:
guest[0]
guest[1]
guest[3]
guest[4]
how can I correct this to:
guest[0]
guest[1]
guest[2]
guest[3]
I thought of using a temp array, copy it over to a correct index the copy the array back to the original, but this seems wrong somehow.
|
|
|
|
|
|
Thanks. I used splice() and it worked
|
|
|
|
|