• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Post string without form?

LEGEND ,
May 13, 2013 May 13, 2013

Copy link to clipboard

Copied

Hello, everyone.

If I use AJaX to POST a string of JSON data without using a form, is it still inserted into the FORM scope, in ColdFusion?

Thank you,

^_^

Views

550

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2013 May 13, 2013

Copy link to clipboard

Copied

Couldn't you knock together a test of this in about 5min?

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 14, 2013 May 14, 2013

Copy link to clipboard

Copied

xhr.open("POST","/path/to/action_page.cfm",false);

xhr.setRequestHeader("Content-type","x-www-form-urlencoded");

xhr.setRequestHeader("Content-Encoding","utf-8");

var thisLength = getLengthInBytes(encodeURI(JSON.stringify(thisArray)));

xhr.setRequestHeader("Content-length",thisLength);

xhr.setRequestHeader("Connection","close");

xhr.send({thisData : ''+encodeURI(JSON.stringify(thisArray)));

var reportText = xhr.responseText;

Web worker.

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 14, 2013 May 14, 2013

Copy link to clipboard

Copied

LATEST

Now it's just academic curiosity.  Instead of the web worker submitting the data directly, I'm just going to have it message the data back to the originating page and submit it from there.

^_^

UPDATE: But I'm still curious about what scope the submitted string is inserted into, as far as CF Server is concerned.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation