Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
8641c3de
...
8641c3dee833cda80b15cf52859e1e5bed280ed2
authored
2011-12-21 07:10:20 -0600
by
Jason Funk
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix indentation and coding standard issues
1 parent
3f46bea9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
lib/casper.js
lib/clientutils.js
lib/casper.js
View file @
8641c3d
lib/clientutils.js
View file @
8641c3d
...
...
@@ -244,27 +244,22 @@
this
.
getBinary
=
function
(
url
,
method
,
data
)
{
try
{
var
xhr
=
new
XMLHttpRequest
();
if
(
method
===
undefined
||
[
"GET"
,
"get"
,
"POST"
,
"post"
].
indexOf
(
method
)
==
-
1
)
{
if
(
method
===
undefined
||
[
"GET"
,
"get"
,
"POST"
,
"post"
].
indexOf
(
method
)
==
-
1
)
{
method
=
"GET"
;
}
else
{
}
else
{
method
=
method
.
toUpperCase
();
}
xhr
.
open
(
method
,
url
,
false
);
this
.
log
(
"
U
sing HTTP method: '"
+
method
+
"'"
,
"debug"
);
this
.
log
(
"
u
sing HTTP method: '"
+
method
+
"'"
,
"debug"
);
xhr
.
overrideMimeType
(
"text/plain; charset=x-user-defined"
);
if
(
method
==
"POST"
)
{
if
(
data
===
undefined
)
{
if
(
method
==
"POST"
)
{
if
(
data
===
undefined
)
{
data_str
=
""
;
}
else
{
}
else
{
data_str
=
""
;
for
(
k
in
data
)
{
if
(
typeof
(
k
)
==
"string"
&&
typeof
(
data
[
k
])
==
"string"
)
{
for
(
k
in
data
)
{
if
(
typeof
(
k
)
==
"string"
&&
typeof
(
data
[
k
])
==
"string"
)
{
data_str
+=
"&"
+
escape
(
k
)
+
"="
+
escape
(
data
[
k
]);
}
}
...
...
@@ -272,7 +267,7 @@
}
xhr
.
setRequestHeader
(
"Content-type"
,
"application/x-www-form-urlencoded"
);
}
this
.
log
(
"
U
sing request data: '"
+
data_str
+
"'"
,
"debug"
);
this
.
log
(
"
u
sing request data: '"
+
data_str
+
"'"
,
"debug"
);
xhr
.
send
(
method
==
"POST"
?
data_str
:
null
);
return
xhr
.
responseText
;
}
catch
(
e
)
{
...
...
Please
register
or
sign in
to post a comment