Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4267054
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:50:44+00:00 2026-05-21T06:50:44+00:00

I want to send image src to browser with AJAX. Server side: que =

  • 0

I want to send image src to browser with AJAX.

Server side:

que = db.Query(Imageitem).order('-created')
item_list = que.fetch(limit=1)
if(len(item_list)>0):
    itemkey = {'imgid':item_list[0].key()}
else:
    itemkey = {'imgid':''}
json_itemkey = gaejsonEncoder.encode(itemkey)

Client side template:

<img src='img?img_id=$(.imgid)'></img>

I use SNBinder for client side binding and $(.imgid) means itemkey[0].imgid.

But this is error.

datastore_types.Key.from_path(u'Imageitem', 515L, _app=u'fileshare')
is not JSON serializable

Is there any way to send the key for datastore entity to client side?

Any advice greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:50:45+00:00Added an answer on May 21, 2026 at 6:50 am

    If you want to JSON encode a key item, just use the string version of the key by passing the key to str():

    itemkey = {'imgid': str(item_list[0].key())}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to resize a image using server side script (eg: Smart Image Resizer
i want to send image file on my php server not upload on php
I want to send image data to the server, For that, I have appended
I want to send image and text data from Android phone to a Server.
I want to send an image between two client/server in Adobe AIR, is there
I want to send iPhone image to server database. I wrote following code. I
I want to send an image to a web server running .Net which is
I have an image in my server which I want to send to my
How can i send image from the client side to server? i have a
I want to use face.com face detection API (send an image to a server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.