How to get images into a slideshow via json javascript with new itok I have just updated to drupal 7.21, and I have massive errors with the new itok suff: Right now I use json_encode(views_get_view_result('viewsitem')), and decode the result with JSON and JavaScript. My slideshow wants to have the normal path but returns things similar to "...sites/default/files/styles/large/public/field/image?itok=M-zTIVI1/mypic.JPG."

Normally, I get the images using the following code.

if (value.field_field_image) {
  var images = value.field_field_image
  // iterating over the images per nid
  for (var i = 0; i &lt; images.length; i++) {
    slideshow_settings.this_slides += '&lt;a class="rsImg" href="'
      + slideshow_settings.basepath + '/' + images[i].raw.filename
      + '"&gt;&lt;/a&gt;';
  }

  pics = slideshow_settings.this_slides;
} 


How can I fix this?
Your root problem seems to be that you are using a side effect of image_style_url().

When you don't pass in a valid image path, you used to get back the basepath of the image style.  Now, with the token patch, it will include the token, and therefore not really be the basepath.  From what I can gather, this is why a lot of modules broke.

The proper thing to do is to use the API to create the URL for you on the server side, instead of gluing together parts in JS.  

This is something that I used on a recent project:

$images = array();
$styles = image_styles();

if (! empty($node-&gt;field_my_image[$node-&gt;language])) {
  foreach ($node-&gt;field_my_image[$node-&gt;language] as $image) {
    $fid = (int) $image['fid'];
    $uri = $image['uri'];
    $url = file_create_url($uri);

    $metadata = array(
      'alt' =&gt; empty($image['alt']) ? '' : $image['alt'],
      'width' =&gt; (int) $image['width'],
      'height' =&gt; (int) $image['height'],
    );

    $metadata['styles'] = array(
      'original' =&gt; $url,
    );

    foreach ($styles as $style =&gt; $unused) {
      $metadata['styles'][$style] = file_create_url(image_style_url($style, $uri));
    }
  }

  $images[$fid] = $metadata;
}

drupal_add_js(array('mymodule' =&gt; array('images' =&gt; $images)), 'setting');


This dumps all of my image fields into a JS array with all of their metadata, including all of the URLs for the image styles that I may need.  My JS code can then use what it needs from this array without worrying about building paths up.